diff --git a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaReliabilityUpdateHistoryRepositoryTest.java b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaReliabilityUpdateHistoryRepositoryTest.java index b498d7e6f..3e365aba4 100644 --- a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaReliabilityUpdateHistoryRepositoryTest.java +++ b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaReliabilityUpdateHistoryRepositoryTest.java @@ -3,8 +3,6 @@ import com.ddang.ddang.configuration.JpaConfiguration; import com.ddang.ddang.configuration.QuerydslConfiguration; import com.ddang.ddang.user.domain.ReliabilityUpdateHistory; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.Test; @@ -23,9 +21,6 @@ @SuppressWarnings("NonAsciiCharacters") class JpaReliabilityUpdateHistoryRepositoryTest { - @PersistenceContext - EntityManager em; - @Autowired JpaReliabilityUpdateHistoryRepository reliabilityUpdateHistoryRepository; @@ -37,9 +32,6 @@ class JpaReliabilityUpdateHistoryRepositoryTest { // when final ReliabilityUpdateHistory actual = reliabilityUpdateHistoryRepository.save(reliabilityUpdateHistory); - em.flush(); - em.clear(); - // then assertThat(actual.getId()).isPositive(); } @@ -62,9 +54,6 @@ class JpaReliabilityUpdateHistoryRepositoryTest { reliabilityUpdateHistoryRepository.saveAll(List.of(history1, history2, history3)); - em.flush(); - em.clear(); - // when final Optional actual = reliabilityUpdateHistoryRepository.findFirstByOrderByIdDesc(); diff --git a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserReliabilityRepositoryTest.java b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserReliabilityRepositoryTest.java index 8cf46db22..ba2f5aae1 100644 --- a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserReliabilityRepositoryTest.java +++ b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserReliabilityRepositoryTest.java @@ -4,8 +4,6 @@ import com.ddang.ddang.configuration.QuerydslConfiguration; import com.ddang.ddang.user.domain.UserReliability; import com.ddang.ddang.user.infrastructure.persistence.fixture.JpaUserReliabilityRepositoryFixture; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.Test; @@ -23,9 +21,6 @@ @SuppressWarnings("NonAsciiCharacters") class JpaUserReliabilityRepositoryTest extends JpaUserReliabilityRepositoryFixture { - @PersistenceContext - EntityManager em; - @Autowired JpaUserReliabilityRepository userReliabilityRepository; @@ -34,9 +29,6 @@ class JpaUserReliabilityRepositoryTest extends JpaUserReliabilityRepositoryFixtu // when UserReliability actual = userReliabilityRepository.save(저장하기_전_사용자_신뢰도_엔티티); - em.flush(); - em.clear(); - // then assertThat(actual.getId()).isPositive(); } diff --git a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserRepositoryTest.java b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserRepositoryTest.java index bdf338989..cb3a10d56 100644 --- a/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserRepositoryTest.java +++ b/backend/ddang/src/test/java/com/ddang/ddang/user/infrastructure/persistence/JpaUserRepositoryTest.java @@ -5,8 +5,6 @@ import com.ddang.ddang.user.domain.Reliability; import com.ddang.ddang.user.domain.User; import com.ddang.ddang.user.infrastructure.persistence.fixture.JpaUserRepositoryFixture; -import jakarta.persistence.EntityManager; -import jakarta.persistence.PersistenceContext; import org.junit.jupiter.api.DisplayNameGeneration; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.Test; @@ -24,9 +22,6 @@ @SuppressWarnings("NonAsciiCharacters") class JpaUserRepositoryTest extends JpaUserRepositoryFixture { - @PersistenceContext - EntityManager em; - @Autowired JpaUserRepository userRepository; @@ -44,9 +39,6 @@ class JpaUserRepositoryTest extends JpaUserRepositoryFixture { final User actual = userRepository.save(user); // then - em.flush(); - em.clear(); - assertThat(actual.getId()).isPositive(); }