해결된 질문
24.03.11 22:42 작성
·
961
0
8분 54초 강의와 마찬가지로 MemberServiceIntegrationTest 테스트 케이스를 실행하였는데 강의와 다른 오류가 발생하였습니다!
오류 내용 - 중복_회원_예외()
java.lang.IllegalStateException: Failed to load ApplicationContext for [WebMergedContextConfiguration@709ed6f3 testClass = com.namu.namuspring.service.MemberServiceIntegrationTest, locations = [], classes = [com.namu.namuspring.NamuSpringApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@485966cc, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7c711375, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@6e0f5f7f, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@1e1a0406, org.springframework.boot.test.context.SpringBootTestAnnotation@793bd5d3], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]
오류 내용 - 회원가입()
java.lang.IllegalStateException: ApplicationContext failure threshold (1) exceeded: skipping repeated attempt to load context for [WebMergedContextConfiguration@709ed6f3 testClass = com.namu.namuspring.service.MemberServiceIntegrationTest, locations = [], classes = [com.namu.namuspring.NamuSpringApplication], contextInitializerClasses = [], activeProfiles = [], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@485966cc, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7c711375, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@6e0f5f7f, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@1e1a0406, org.springframework.boot.test.context.SpringBootTestAnnotation@793bd5d3], resourceBasePath = "src/main/webapp", contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]
답변 1
0
강의를 수강하면서 h2 데이터베이스를 추가한 강좌를 학습하셨을거에요.
h2 데이터베이스를 사용한다면 스프링에도 관련된 설정을 적용하셔야 합니다.
강의 진행에 누락되거나, 강의와 다르게 작성한 부분을 짚어드릴테니 확인 후 수정하여 진행해주세요
(1) application.properties의 h2 설정 누락
(2) SpringConfig 내 생성자 누락
강의코드
첨부해주신 코드
(3) SpringConfig 클래스의 위치(강의진행에 문제는 없습니다)
강의 코드 위치
첨부해주신 코드 위치
2024. 03. 12. 14:51
https://drive.google.com/file/d/1tCGTwMtU3DewnN72QsrOch5DFP-6uthL/view?usp=sharing
제가 인텔리제이를 꺼버려서 아이콘이 사라져버렸네요 ㅠ...
부트도 지금 안켜겨가지고 코드 링크로 올리겠습니다!
============================
CONDITIONS EVALUATION REPORT
============================
Positive matches:
-----------------
None
Negative matches:
-----------------
None
Exclusions:
-----------
None
Unconditional classes:
----------------------
None