사용자 도구

사이트 도구


springframework:test

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
springframework:test [2015/05/07 11:19]
kwon37xi
springframework:test [2021/07/22 17:01] (현재)
kwon37xi
줄 1: 줄 1:
 ====== Springframework Test ====== ====== Springframework Test ======
 +  * [[java:junit|JUnit]]
 +  * [[java:unittest|Java Unit Test]]
   * [[http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.html|SpringJUnit4ClassRunner]]   * [[http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/junit4/SpringJUnit4ClassRunner.html|SpringJUnit4ClassRunner]]
 +  * [[java:junit:database_rider|database-rider]]
 +  * [[springframework:spring_test_dbunit|Spring Test DBUnit]]
 +  * [[springframework:mvc:unittest|Spring MVC UnitTest]]
 +
 +===== @ContextHierarchy =====
 +  * ''@org.springframework.test.context.ContextHierarchy''
 +  * 컨텍스트간의 계층을 두어 설정. 이 안에 ''@ContextConfiguration''을 계층적으로 선언
  
 ===== @ContextConfiguration 이중 지정문제 ===== ===== @ContextConfiguration 이중 지정문제 =====
줄 8: 줄 17:
     Process 'Gradle Test Executor 1' finished with non-zero exit value 134     Process 'Gradle Test Executor 1' finished with non-zero exit value 134
 </code> </code>
 +
 +===== Test Class 자체에 컨텍스트 설정 넣기 =====
 +<code java>
 +@RunWith(SpringJUnit4ClassRunner.class)
 +@ContextConfiguration // 이 부분 추가
 +public class MySpringTest {
 +    @Configuration
 +    public static class TestConfig {
 +        // 기타 설정..
 +    }
 +    
 +    @Autowired //.. injection...
 +}
 +</code>
 +
 +===== @TestPropertySource =====
 +  * [[https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/test/context/TestPropertySource.html|@TestPropertySource]]
 +
 +===== @IfProfileValue =====
 +  * [[https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/annotation/IfProfileValue.html|IfProfileValue (Spring Framework 5.3.9 API)]]
 +  * 프라퍼티 값에 따라 테스트 실행 여부 결정.
 +
 +===== WebClient / WebTestClient =====
 +  * [[https://www.callicoder.com/spring-5-reactive-webclient-webtestclient-examples/?fbclid=IwAR2QMj5NdEHL4NHopq_0FCfk-l3dMk46mX2Oy72-MN1Ptu-URVfJImtpXsg|Spring 5 WebClient and WebTestClient Tutorial with Examples | CalliCoder]]
  
springframework/test.1430965195.txt.gz · 마지막으로 수정됨: 2015/05/07 11:19 저자 kwon37xi