문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework:test [2015/05/07 11:19] kwon37xi |
springframework:test [2021/07/22 17:01] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Springframework Test ====== | ====== Springframework Test ====== | ||
| + | * [[java: | ||
| + | * [[java: | ||
| * [[http:// | * [[http:// | ||
| + | * [[java: | ||
| + | * [[springframework: | ||
| + | * [[springframework: | ||
| + | |||
| + | ===== @ContextHierarchy ===== | ||
| + | * '' | ||
| + | * 컨텍스트간의 계층을 두어 설정. 이 안에 '' | ||
| ===== @ContextConfiguration 이중 지정문제 ===== | ===== @ContextConfiguration 이중 지정문제 ===== | ||
| * '' | * '' | ||
| * '' | * '' | ||
| - | Caused by: org.gradle.process.internal.ExecException: | + | Caused by: org.gradle.process.internal.ExecException: |
| + | | ||
| </ | </ | ||
| + | |||
| + | ===== Test Class 자체에 컨텍스트 설정 넣기 ===== | ||
| + | <code java> | ||
| + | @RunWith(SpringJUnit4ClassRunner.class) | ||
| + | @ContextConfiguration // 이 부분 추가 | ||
| + | public class MySpringTest { | ||
| + | @Configuration | ||
| + | public static class TestConfig { | ||
| + | // 기타 설정.. | ||
| + | } | ||
| + | | ||
| + | @Autowired //.. injection... | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== @TestPropertySource ===== | ||
| + | * [[https:// | ||
| + | |||
| + | ===== @IfProfileValue ===== | ||
| + | * [[https:// | ||
| + | * 프라퍼티 값에 따라 테스트 실행 여부 결정. | ||
| + | |||
| + | ===== WebClient / WebTestClient ===== | ||
| + | * [[https:// | ||