mainDiscountPolicy 사용 시 StartApplicationTest에서 에러가 납니다
288
작성한 질문수 1
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? 예
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예
3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예
[질문 내용]
여기에 질문 내용을 남겨주세요. mainDiscountPolicy를 만들고 test를 돌려봤는데 다음과 같은 에러가 납니다.StartApplicationTest를 제외하고는 다 통과합니다.잘 따라한 것 같은데 에러가 나서 질문드립니다. 어떻게 해결해야 할까요? java.lang.IllegalStateException: Failed to load ApplicationContext for [MergedContextConfiguration@15f2eda3 testClass = spring.demo.StartApplicationTests, locations = [], classes = [spring.demo.StartApplication], 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@27912e3, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@30b6ffe0, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@24c22fe, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@72ade7e3, org.springframework.boot.test.context.SpringBootTestAnnotation@315e37a3], contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null]
답변 1
0
안녕하세요. 한지원님
다음을 참고해주세요.
그래도 이슈가 해결되지 않으면
실제 동작하는 전체 프로젝트를 압축해서 구글 드라이브로 공유해서 링크를 남겨주세요.
구글 드라이브 업로드 방법은 다음을 참고해주세요.
주의: 업로드시 링크에 있는 권한 문제 꼭 확인해주세요
추가로 다음 내용도 코멘트 부탁드립니다.
1. 문제 영역을 실행할 수 있는 방법
2. 문제가 어떻게 나타나는지에 대한 상세한 설명
링크: 공식 서포터즈
링크: 자주하는 질문
감사합니다.
감사합니다.
1
답변감사합니다.
확인해보니 @Component 가 fixDiscountPolicy가 아닌 rateDiscountPolicy에 있어 발생하는 문제였습니다. 고쳐서 바로 해결했습니다.
빈 스코프 개념의 중요성
0
21
1
SingletonService가 JVM이 뜰 때 생성되는게 맞나요?
0
66
2
섹션3. 11 회원객체 다이어그램
0
38
1
OCP, DIP과 @Qualifier 어노테이션에 대해서 질문합니다.
0
40
1
코드 자료
0
86
2
구현체가 동적으로 정해질 때, 팩토리 기법을 사용하나요?
0
83
2
MemberService의 인터페이스를 왜 사용하는지 궁금합니다.
0
100
1
롬복 @Setter를 써야 하는 상황이 있는건가요?
0
104
1
빈 등록 메서드의 파라미터가 빈이 아니어도 되나요?
0
89
1
테스트 속도가 나중에 영향이 있을까요?
0
91
1
gradle 설정 안떠서 질문 남깁니다!
0
147
2
build.gradle로 프로젝트를 여는 이유
0
101
1
provider 사용하는 이유
0
99
1
다음 강의 뭘 들어야 할까요
0
140
2
프로토타입 빈, 직접 destroy 호출 안 할 경우
0
70
1
beanB
0
94
2
퀴즈다시풀기
0
77
1
Gradle로 바꿔도 오류가 똑같이 발생하네요 ㅠㅠ
0
105
2
"중복 등록과 충돌" 강의에서 강사님과 다른 에러가 발생합니다.
0
72
3
run 실행했는데 결과창이 이렇게 뜨네요 왜 그런건가요>
0
116
2
도메인의 정의?
0
64
1
ApplicationContext 질문입니다.
0
68
1
@Scope의 proxyMode를 사용할때 단위 테스트 방법
0
98
2
ai api 선정하기 관련 질문
0
141
2





