Skip to content

Commit

Permalink
JUnit 버전 낮춤, @DirtiesContext 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
fp024 committed Feb 8, 2024
1 parent ccfc623 commit 949a451
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions introducing-interceptors/interceptors-struts/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<name>${project.artifactId} - Struts 2 Study Maven Webapp</name>
<url>https://github.com/fp024/struts2-study/tree/master/introducing-interceptors</url>

<properties>
<junit.version>5.10.1</junit.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -39,7 +37,7 @@ void testList() {
assertFalse(list.isEmpty());
}

@Order(2)
@Order(3)
@Test
@Transactional
@Rollback // 테스트 환경에서는 기본이 롤백이여서 일부러 이 어노테이션을 붙여줄 필요는 없다. 반영이 필요하면 @Commit을 붙인다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 949a451

Please sign in to comment.