diff --git a/backend/src/test/java/ch/puzzle/okr/service/persistence/UserPersistenceServiceIT.java b/backend/src/test/java/ch/puzzle/okr/service/persistence/UserPersistenceServiceIT.java index 55ac22a909..0104060b48 100644 --- a/backend/src/test/java/ch/puzzle/okr/service/persistence/UserPersistenceServiceIT.java +++ b/backend/src/test/java/ch/puzzle/okr/service/persistence/UserPersistenceServiceIT.java @@ -1,6 +1,5 @@ package ch.puzzle.okr.service.persistence; -import ch.puzzle.okr.OkrApplicationContextInitializer; import ch.puzzle.okr.models.User; import ch.puzzle.okr.multitenancy.TenantContext; import ch.puzzle.okr.test.SpringIntegrationTest; @@ -8,8 +7,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; @@ -22,8 +19,6 @@ @SpringIntegrationTest class UserPersistenceServiceIT { - private static final Logger logger = LoggerFactory.getLogger(UserPersistenceServiceIT.class); - private User createdUser; @Autowired @@ -159,24 +154,12 @@ void findByEmailShouldReturnEmptyOptionalIfEmailIsNull() { @DisplayName("findAllOkrChampions() should return all okr champions") @Test void findAllOkrChampionsShouldReturnAllOkrChampions() { - var allUsers = userPersistenceService.findAll(); - logger.warn("*** ALL USERS"); - allUsers.forEach(user -> { - logger.warn(user.toString()); - }); - - logger.warn("*** ALL OKR CHAMPIONS V1"); - allUsers.stream().filter(user -> user.isOkrChampion()).toList().forEach(champion -> { - logger.warn(champion.toString()); - }); - + // act var allOkrChampions = userPersistenceService.findAllOkrChampions(); - logger.warn("*** ALL OKR CHAMPIONS V2"); - allOkrChampions.forEach(user -> logger.warn(user.toString())); + // assert assertEquals(1, allOkrChampions.size()); - assertEquals("Jaya", allOkrChampions.get(0).getFirstname()); - assertEquals("Norris", allOkrChampions.get(0).getLastname()); + assertUser(61L, "Jaya", "Norris", "gl@gl.com", allOkrChampions.get(0)); } @DisplayName("getModelName() should return user")