문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework:springboot:test [2022/03/25 14:17] kwon37xi [''@SpringBootApplication'' 클래스 탐지] |
springframework:springboot:test [2022/08/31 16:02] (현재) kwon37xi [SpringBoot Test] |
||
|---|---|---|---|
| 줄 3: | 줄 3: | ||
| * [[java: | * [[java: | ||
| * [[springframework: | * [[springframework: | ||
| - | * [[https:// | + | |
| + | | ||
| ===== @SpringBootTest ===== | ===== @SpringBootTest ===== | ||
| * 기본적인 SpringBoot 통합 테스트 어노테이션. | * 기본적인 SpringBoot 통합 테스트 어노테이션. | ||
| * 이 안에 들어가면 '' | * 이 안에 들어가면 '' | ||
| + | * | ||
| + | '' | ||
| ==== @SpringBootApplication 클래스 탐지 ==== | ==== @SpringBootApplication 클래스 탐지 ==== | ||
| 줄 26: | 줄 29: | ||
| * 즉, DB 접속등이 이뤄지는 컨텍스트의 경우 connection pool 로 인해서 DB 서버의 커넥션 수가 꽉차는 상황이 발생할 수 있다. | * 즉, DB 접속등이 이뤄지는 컨텍스트의 경우 connection pool 로 인해서 DB 서버의 커넥션 수가 꽉차는 상황이 발생할 수 있다. | ||
| * **Test 용 설정에서 Connection Pool의 min 사이즈는 작게 잡는게 좋다** | * **Test 용 설정에서 Connection Pool의 min 사이즈는 작게 잡는게 좋다** | ||
| - | + | * [[https:// | |
| - | ==== '' | + | <code properties> |
| + | # 32mb 기본값 | ||
| + | spring.test.context.cache.maxSize=32 | ||
| + | </ | ||
| + | ==== @TestConfiguration ==== | ||
| * [[https:// | * [[https:// | ||
| * Test 용 '' | * Test 용 '' | ||
| 줄 34: | 줄 41: | ||
| * '' | * '' | ||
| * 혹은 '' | * 혹은 '' | ||
| - | * Test 시에는 기존 bean 을 override 해야 할 수 있기 때문에 | + | * Test 시에는 기존 bean 을 override 해야 할 수 있기 때문에 |
| + | |||
| + | <code properties> | ||
| + | spring.main.allow-bean-definition-overriding=true | ||
| + | </ | ||
| ==== Unable to find a @SpringBootConfiguration, | ==== Unable to find a @SpringBootConfiguration, | ||
| 줄 103: | 줄 114: | ||
| * [[https:// | * [[https:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||