SpringBoot/테스트코드
[Springboot 단위테스트]MockMvc Bean을 주입받지 못하는 에러
devebucks
2020. 7. 26. 17:03
728x90
에러내용.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.studyolle.settings.profileTest': Unsatisfied dependency expressed through field 'mockMvc'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc'
해결방법 : @AuthConfigureWebMvc로 해서 오류가 났었습니다. @AuthConfigureMockMvc로 수정하니 잘되었습니다.
728x90