Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Jan 30, 2025
1 parent e675e2c commit 70a0dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void saveShouldSaveUserWithEmptyUserTeamList() {

// assert
assertNotNull(createdUnit.getId());
assertUser("Mocked user first name for test", "Mocked user last name for test", "[email protected]", createdUnit.getCreatedBy());
assertUser("mocked user first name for test", "mocked user last name for test", "[email protected]", createdUnit.getCreatedBy());
unitPersistenceService.deleteById(createdUnit.getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ public SecurityContext createSecurityContext(WithMockAuthUser annotation) {
User user = User.Builder
.builder()
.withEmail(annotation.email())
.withFirstName("Mocked user first name for test")
.withFirstName("mocked user first name for test")
.withLastName("mocked user last name for test")
.build();
// Optional<User> byEmail = this.userPersistenceService.findByEmail(annotation.email());
// byEmail.ifPresentOrElse(
// (u) -> {
// user.setFirstName(u.getFirstName());
// user.setLastName(u.getLastName());
// }, ()->{}
// );
Optional<User> byEmail = this.userPersistenceService.findByEmail(annotation.email());
byEmail.ifPresentOrElse(
(u) -> {
user.setFirstName(u.getFirstName());
user.setLastName(u.getLastName());
}, ()->{}
);
context.setAuthentication(new JwtAuthenticationToken(TestHelper.mockJwtToken(user), List.of()));
return context;
}
Expand Down

0 comments on commit 70a0dc9

Please sign in to comment.