Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
clean-coder committed Oct 24, 2024
1 parent 388cd68 commit 40cbaa9
Showing 1 changed file with 3 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
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;
import org.junit.jupiter.api.AfterEach;
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;
Expand All @@ -22,8 +19,6 @@
@SpringIntegrationTest
class UserPersistenceServiceIT {

private static final Logger logger = LoggerFactory.getLogger(UserPersistenceServiceIT.class);

private User createdUser;

@Autowired
Expand Down Expand Up @@ -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", "[email protected]", allOkrChampions.get(0));
}

@DisplayName("getModelName() should return user")
Expand Down

0 comments on commit 40cbaa9

Please sign in to comment.