diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 4f5ff81..b03a870 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -12,7 +12,7 @@ spring: jdbc: time_zone: Asia/Seoul hibernate: - ddl-auto: update + ddl-auto: none h2: console: diff --git a/src/test/java/com/potatocake/everymoment/repository/DiaryRepositoryTest.java b/src/test/java/com/potatocake/everymoment/repository/DiaryRepositoryTest.java index bb2f2b8..8694a1e 100644 --- a/src/test/java/com/potatocake/everymoment/repository/DiaryRepositoryTest.java +++ b/src/test/java/com/potatocake/everymoment/repository/DiaryRepositoryTest.java @@ -12,15 +12,12 @@ import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.Point; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.jpa.domain.Specification; @DataJpaTest -@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) class DiaryRepositoryTest { @Autowired @@ -29,9 +26,6 @@ class DiaryRepositoryTest { @Autowired private MemberRepository memberRepository; - @Autowired - private TestEntityManager entityManager; - @Test @DisplayName("일기가 성공적으로 저장된다.") void should_SaveDiary_When_ValidEntity() { @@ -59,8 +53,6 @@ void should_FindDiaries_When_FilteringByMember() { Diary diary2 = createDiary(member, "Content 2", "Busan", "Address 2"); diaryRepository.saveAll(List.of(diary1, diary2)); - entityManager.flush(); - entityManager.clear(); // when Specification spec = (root, query, builder) -> @@ -104,8 +96,6 @@ void should_FindDiaries_When_FilteringWithSearchCriteria() { .build(); diaryRepository.saveAll(List.of(diary1, diary2)); - entityManager.flush(); - entityManager.clear(); // when Specification spec = DiarySpecification.filterDiaries( @@ -155,8 +145,6 @@ void should_FindDiaries_When_FilteringBookmarked() { .build(); diaryRepository.saveAll(List.of(diary1, diary2)); - entityManager.flush(); - entityManager.clear(); // when Specification spec = DiarySpecification.filterDiaries( @@ -197,5 +185,5 @@ private Diary createDiary(Member member, String content, String locationName, St .isPublic(false) .build(); } - + }