Skip to content

Commit

Permalink
fix[user]: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Marjoni committed Mar 20, 2026
1 parent ae861cb commit d60c6d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ void getNextUserIdReturns1IfEmpty() {
assertEquals(1, emptyRepo.getNextUserId());
}

@Test
void exportContainsAllUsers() {
List<Object[]> exported = repo.export();
assertEquals(2, exported.size());
assertEquals(1, exported.get(0)[0]);
assertEquals(2, exported.get(1)[0]);
assertEquals("Customer", exported.get(0)[1]);
}

@Test
void exportExportsOnlyNewInformation() {
assertEquals(0, repo.export().size());
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/edu/group5/app/model/user/UserServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,20 @@ void loginInvalidEmail() {
assertNull(result2);
assertNull(result3);
}

@Test
void getUserByEmailValid() {
User result = service.getUserByEmail("jane.doe@example.com");
assertEquals("Jane", result.getFirstName());
}

@Test
void getUserByEmailNotFound() {
User result = service.getUserByEmail("");
User result2 = service.getUserByEmail(null);
User result3 = service.getUserByEmail(" ");
assertNull(result);
assertNull(result2);
assertNull(result3);
}
}

0 comments on commit d60c6d5

Please sign in to comment.