Skip to content

Commit

Permalink
Increased coverage of ServerService. (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfloe authored Sep 2, 2024
1 parent 9da322f commit 6da56fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* @param students the students in the student group
* @param grades the grades of the student group
* @param tags the tags of the student group
* @param lessons the lessons of the student group
* @param subjects the subjects of the student group
*/
public record StudentGroupResponseDto(@NotEmpty String id,
Expand Down
12 changes: 12 additions & 0 deletions server/src/test/java/de/uftos/services/ServerServiceTests.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package de.uftos.services;

import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import de.uftos.dto.requestdtos.ServerEmailRequestDto;
import de.uftos.dto.responsedtos.ServerEmailResponseDto;
import de.uftos.dto.responsedtos.ServerStatisticsResponseDto;
import de.uftos.entities.Break;
import de.uftos.entities.Server;
Expand Down Expand Up @@ -116,5 +119,14 @@ void setMetadata() {
assertEquals(server.getCurrentYear(), "2024");
}

@Test
void getEmail() {
assertDoesNotThrow(() -> serverService.getEmail());
assertEquals(new ServerEmailResponseDto("test@uftos.de"), serverService.getEmail());
}

@Test
void setEmail() {
assertDoesNotThrow(() -> serverService.setEmail(new ServerEmailRequestDto("mail@example.org")));
}
}

0 comments on commit 6da56fd

Please sign in to comment.