From b14600add866952557fe8e4065dcaa849336be02 Mon Sep 17 00:00:00 2001 From: fp024 Date: Fri, 9 Feb 2024 10:04:58 +0900 Subject: [PATCH] =?UTF-8?q?`@DirtiesContext`=EC=9D=98=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=82=AC=EC=9A=A9=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 수정이 일어났을 때만 초기화 해주면 되므로, PersonRepositoryTest의 `@DirtiesContext`는 제거한다. 클래스에 붙였을 때, 기본 동작은 해당 테스트 클래스 실행 후 이다. --- .../struts2/study/register/repository/PersonRepositoryTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/repository/PersonRepositoryTest.java b/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/repository/PersonRepositoryTest.java index 53e7199..562cbf4 100644 --- a/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/repository/PersonRepositoryTest.java +++ b/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/repository/PersonRepositoryTest.java @@ -14,14 +14,12 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; import org.springframework.transaction.annotation.Transactional; @Slf4j @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@DirtiesContext @SpringJUnitConfig(locations = {"classpath:applicationContext.xml"}) class PersonRepositoryTest { @Autowired private PersonRepository personRepository;