테스트 케이스 작성시 spring4의 설정파일을 로드하기 위해

 

@ExtendWith(SpringExtension.class)
@ContextConfiguration
(
{
   "file:src/main/resources/egovframework/spring/context-aspect.xml",
   "file:src/main/resources/egovframework/spring/context-common.xml",
   "file:src/main/resources/egovframework/spring/context-datasource.xml",
   "file:src/main/resources/egovframework/spring/context-hibernate.xml",
   "file:src/main/resources/egovframework/spring/context-idgen.xml",
   "file:src/main/resources/egovframework/spring/context-mapper.xml",
   "file:src/main/resources/egovframework/spring/context-properties.xml",
   "file:src/main/resources/egovframework/spring/context-springdata.xml",
   "file:src/main/resources/egovframework/spring/context-sqlMap.xml",
   "file:src/main/resources/egovframework/spring/context-transaction.xml"
  }
)

 

같이 설정파일을 업로드 해줘야 합니다.

@RunWith(SpringJUnit4ClassRunner.class) -> @ExtendWith(SpringExtension.class)

반응형
Posted by 질주하는구
,