From 949a4517f913a8315c959d714721c35ff87f3c14 Mon Sep 17 00:00:00 2001 From: fp024 Date: Thu, 8 Feb 2024 22:32:28 +0900 Subject: [PATCH] =?UTF-8?q?JUnit=20=EB=B2=84=EC=A0=84=20=EB=82=AE=EC=B6=A4?= =?UTF-8?q?,=20`@DirtiesContext`=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- introducing-interceptors/interceptors-struts/pom.xml | 4 ++++ .../study/register/repository/PersonRepositoryTest.java | 4 +--- .../struts2/study/register/service/RegisterServiceTest.java | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/introducing-interceptors/interceptors-struts/pom.xml b/introducing-interceptors/interceptors-struts/pom.xml index ab3e487..6b93d65 100644 --- a/introducing-interceptors/interceptors-struts/pom.xml +++ b/introducing-interceptors/interceptors-struts/pom.xml @@ -18,6 +18,10 @@ ${project.artifactId} - Struts 2 Study Maven Webapp https://github.com/fp024/struts2-study/tree/master/introducing-interceptors + + 5.10.1 + + org.apache.struts 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 fc1b660..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; @@ -39,7 +37,7 @@ void testList() { assertFalse(list.isEmpty()); } - @Order(2) + @Order(3) @Test @Transactional @Rollback // 테스트 환경에서는 기본이 롤백이여서 일부러 이 어노테이션을 붙여줄 필요는 없다. 반영이 필요하면 @Commit을 붙인다. diff --git a/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/service/RegisterServiceTest.java b/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/service/RegisterServiceTest.java index 7cbe3a1..aa2d0a7 100644 --- a/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/service/RegisterServiceTest.java +++ b/introducing-interceptors/interceptors-struts/src/test/java/org/fp024/struts2/study/register/service/RegisterServiceTest.java @@ -10,11 +10,9 @@ 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.context.junit.jupiter.SpringJUnitConfig; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@DirtiesContext @SpringJUnitConfig(locations = {"classpath:applicationContext.xml"}) class RegisterServiceTest { @Autowired private RegisterService registerService;