06. Spring Security OAuth JWT Test
문제
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)
at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:350)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:355)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$7(ClassBasedTestDescriptor.java:350)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:349)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$4(ClassBasedTestDescriptor.java:270)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:269)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:259)
at java.util.Optional.orElseGet(Optional.java:267)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:258)
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:101)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:100)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:65)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:111)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:111)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:79)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' available
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:123)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
... 67 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' available
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 87 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.oauth2.client.registration.ClientRegistrationRepository' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:351)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
at org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2ClientConfigurerUtils.getClientRegistrationRepositoryBean(OAuth2ClientConfigurerUtils.java:56)
at org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2ClientConfigurerUtils.getClientRegistrationRepository(OAuth2ClientConfigurerUtils.java:48)
at org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer.init(OAuth2LoginConfigurer.java:291)
at org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer.init(OAuth2LoginConfigurer.java:139)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:338)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:300)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:285)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:83)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:305)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 88 more
원인
application.yml 설정에 아래와 같이 설정이 되지 않아 있기 때문에 발생하는 오류이다
해결
spring
security:
oauth2:
client:
registration:
naver:
clientId: { 클라언트 아이디 }
client-secret: { 클라이언트 비밀번호 }
redirect-uri: "{baseUrl}/oauth2/callback/{registrationId}"
authorization-grant-type: authorization_code
scope:
- name
- email
- profile_image
client-name: Naver
provider:
naver:
authorization_uri: https://nid.naver.com/oauth2.0/authorize
token_uri: https://nid.naver.com/oauth2.0/token
user-info-uri: https://openapi.naver.com/v1/nid/me
user_name_attribute: response
위와 같이 application.yml 로 설정하거나
Security InMemoryClientRegistrationRepository 클래스에 있는 ClientRegistration 클래스를 Bean 으로 등록하여 값을 넣어주면 해결 될 것이다
문제 2
테스트 코드
@ExtendWith(value = {SpringExtension.class})
@WebMvcTest(controllers = MemberApi.class)
class MemberApiTestSecurity {
@Autowired
private MockMvc mvc;
@MockBean
private MemberFindService memberFindService;
@Test
@DisplayName("멤버 조회")
@CustomMockUser(id = 1L, name = "sout1217", email = "sout1217@gmaile.com")
void memberFindById() throws Exception {
// given
given(memberFindService.findById(1L)).willReturn(
Member.builder()
.name("sout1217")
.email("sout1217@gmail.com")
.provider(AuthProvider.google)
.providerId("123123")
.profileImg("http://123123")
.nickName(null)
.build()
);
// when
ResultActions actions = mvc.perform(get("/api/v1/members")
);
// then
actions
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value("sout1217"))
;
}
}
에러 내용
C:\Users\hbh\.jdks\corretto-1.8.0_282\bin\java.exe -Dvisualvm.id=1751812278900 -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar=60256:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\lib\idea_rt.jar;C:\Users\hbh\.m2\repository\org\junit\platform\junit-platform-launcher\1.7.2\junit-platform-launcher-1.7.2.jar;C:\Users\hbh\.m2\repository\org\apiguardian\apiguardian-api\1.1.0\apiguardian-api-1.1.0.jar;C:\Users\hbh\.m2\repository\org\junit\platform\junit-platform-engine\1.7.2\junit-platform-engine-1.7.2.jar;C:\Users\hbh\.m2\repository\org\opentest4j\opentest4j\1.2.0\opentest4j-1.2.0.jar;C:\Users\hbh\.m2\repository\org\junit\platform\junit-platform-commons\1.7.2\junit-platform-commons-1.7.2.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.1\plugins\junit\lib\junit-rt.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\charsets.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\access-bridge-64.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\cldrdata.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\dnsns.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\jaccess.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\jfxrt.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\localedata.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\nashorn.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\sunec.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\sunjce_provider.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\sunmscapi.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\sunpkcs11.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\ext\zipfs.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\jce.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\jfr.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\jfxswt.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\jsse.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\management-agent.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\resources.jar;C:\Users\hbh\.jdks\corretto-1.8.0_282\jre\lib\rt.jar;C:\project\what_should_i_eat_today_back\out\test\classes;C:\project\what_should_i_eat_today_back\out\test\resources;C:\project\what_should_i_eat_today_back\out\production\classes;C:\project\what_should_i_eat_today_back\out\production\resources;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\2.5.3\6e57512b8907710566daf2b246c724de3e38ad14\spring-boot-starter-data-jpa-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-mail\2.5.3\43e94e3a63c5146f5c892e3e3b662263300cf747\spring-boot-starter-mail-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-mustache\2.5.3\81e50b7ffcb3b94d2965861c867363832d271db3\spring-boot-starter-mustache-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\2.5.3\f0b59a90ac52008f7cab9c30ca56cba5624f1f4a\spring-boot-starter-security-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\2.5.3\ddf0c32b49a92927db754c26db3f1454bd3728ed\spring-boot-starter-validation-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\2.5.3\2cb23f2928177eeb9be81036623f4350a86a433\spring-boot-starter-web-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\p6spy-spring-boot-starter\1.7.1\78caca4d76c2612c790538afe2e54a489029f733\p6spy-spring-boot-starter-1.7.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-jpa\4.4.0\11e3c6a6ec45f3e05317111eb59551a7c2c0cc51\querydsl-jpa-4.4.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-oauth2-client\2.5.3\8c58f7ad8eb911eba922ab6911743ad27eaa5142\spring-boot-starter-oauth2-client-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt\0.9.1\54d2abfc3e63a28824d35bf600d6a5d627da681a\jjwt-0.9.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-test\2.5.3\b3e6075daed4c81d5f1d5fa340debdc3241cc3dc\spring-boot-starter-test-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-test\5.5.1\fa18a1f9af0bbc42b639fb9e9479f25d9e03d7ea\spring-security-test-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\2.5.3\45a790c9abe248865e0ad2d1f8622d55877eb4f7\spring-boot-starter-aop-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\2.5.3\ffc2a4b05d901775e5a96cc73450a1d072baecfa\spring-boot-starter-jdbc-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\1.3.3\c4179d48720a1e87202115fbed6089bdc4195405\jakarta.transaction-api-1.3.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\2.2.3\8f6ea5daedc614f07a3654a455660145286f024e\jakarta.persistence-api-2.2.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.hibernate\hibernate-core\5.4.32.Final\99a5e10bf455337014c190e141ec631e9ff71663\hibernate-core-5.4.32.Final.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\2.5.3\41db71033651f476fbc62a485387a4e891ec9940\spring-data-jpa-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\5.3.9\ee2c3f8f99e1f115f502a7e47e632b1ed229e766\spring-aspects-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\2.5.3\2e16fb3d63961548468a2cd70015d4b1be968fd4\spring-boot-starter-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context-support\5.3.9\9aeab3bea52f94e54bcf6b82c1e515aa3529ab63\spring-context-support-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.sun.mail\jakarta.mail\1.6.7\319df0e9d536c1a01acdfe49b6e82b97d2393073\jakarta.mail-1.6.7.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.samskivert\jmustache\1.15\7b3b15951d13b774c76db2f4e14d977952f8b4d8\jmustache-1.15.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-config\5.5.1\a4610e934dd52d7871bf2f3e923dfee99be76636\spring-security-config-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-web\5.5.1\e042c61f262096193a021f635511cc3922a78510\spring-security-web-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\5.3.9\9bcad31a74e60d205500dd67d2220bd0195c63f8\spring-aop-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\9.0.50\ee4e14e128bf6ffe7650c7a5d8cedf97fb36d91b\tomcat-embed-el-9.0.50.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\6.2.0.Final\d6b0760dfffbf379cedd02f715ff4c9a2e215921\hibernate-validator-6.2.0.Final.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\2.5.3\10336b02e83756f916c0d9510555046cacfc2005\spring-boot-starter-json-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\5.3.9\c3cd1f0bba2658995e887d2f0011ab9bd3da1773\spring-webmvc-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\2.5.3\bedcf69b9e83a0744d93e5672320039b55deffd\spring-boot-starter-tomcat-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\5.3.9\88c920ec1bda67fea04daa8e16165777440df473\spring-web-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\datasource-decorator-spring-boot-autoconfigure\1.7.1\5f7b27f26027d0390ebaf5a262d85543ff406a9\datasource-decorator-spring-boot-autoconfigure-1.7.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\p6spy\p6spy\3.9.0\7fedf78cc1e53a623a7b36d1f2705790836400aa\p6spy-3.9.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-core\4.4.0\8003e2da99c4fa83f917750f5b1f42e937be11ce\querydsl-core-4.4.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\javax.inject\javax.inject\1\6975da39a7040257bd51d21a231b76c915872d38\javax.inject-1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\1.7.32\cdcff33940d9f2de763bc41ea05a0be5941176c3\slf4j-api-1.7.32.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-client\5.5.1\38a84a2f290e89525356992f19e41a402dc53834\spring-security-oauth2-client-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-jose\5.5.1\17363bdae49bd41f44cf12a5044d011577559b92\spring-security-oauth2-jose-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-core\5.5.1\e7cc9d0e918d97419fcc97f08cdade945b1144d7\spring-security-core-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.12.4\69206e02e6a696034f06a59d3ddbfbba5a4cd81\jackson-databind-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test-autoconfigure\2.5.3\57751a3e312da7db3226e24d1ba4a6b0d475de30\spring-boot-test-autoconfigure-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-test\2.5.3\bba801d1ba60438699c9410a91f23b4880394bda\spring-boot-test-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.jayway.jsonpath\json-path\2.5.0\c35ef29095125b51638d19120f63e2b56eff20e9\json-path-2.5.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\2.3.3\48e3b9cfc10752fba3521d6511f4165bea951801\jakarta.xml.bind-api-2.3.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.assertj\assertj-core\3.19.0\f64cb5690b85e68d5e1e6c6152bfb6e3840a452d\assertj-core-3.19.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.hamcrest\hamcrest\2.2\1820c0968dba3a11a1b30669bb1f01978a91dedc\hamcrest-2.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter\5.7.2\62faa742964a9d8dab8fdb4a0eab7b01441c171f\junit-jupiter-5.7.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-junit-jupiter\3.9.0\871745ab6af5a269411ea3c1f99ced82ed079436\mockito-junit-jupiter-3.9.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.mockito\mockito-core\3.9.0\b7573430aea743b26434b44f4f46272af613e660\mockito-core-3.9.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.skyscreamer\jsonassert\1.5.0\6c9d5fe2f59da598d9aefc1cfc6528ff3cf32df3\jsonassert-1.5.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-test\5.3.9\62d85d0b20318bd036fe2a78e2de96026bacc916\spring-test-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\5.3.9\cfef19d1dfa41d56f8de66238dc015334997d573\spring-core-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.xmlunit\xmlunit-core\2.8.2\8e4e46b87afaaf9b6cfb8de778e473cf7aeb087f\xmlunit-core-2.8.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.7\158f5c255cd3e4408e795b79f7c3fbae9b53b7ca\aspectjweaver-1.9.7.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\4.0.3\107cbdf0db6780a065f895ae9d8fbf3bb0e1c21f\HikariCP-4.0.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\5.3.9\18efdbd53c154a08e1854a6cff29c2becea04025\spring-jdbc-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\2.3.4\5f3828d3a345ff3d8acb83f07ba04eccf59e15bb\jaxb-runtime-2.3.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\5.1.2.Final\e59ffdbc6ad09eeb33507b39ffcf287679a498c8\hibernate-commons-annotations-5.1.2.Final.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.4.2.Final\e517b8a93dd9962ed5481345e4d262fdd47c4217\jboss-logging-3.4.2.Final.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.javassist\javassist\3.27.0-GA\f63e6aa899e15eca8fdaa402a79af4c417252213\javassist-3.27.0-GA.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.10.22\ef45d7e2cd1c600d279704f492ed5ce2ceb6cdb5\byte-buddy-1.10.22.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\antlr\antlr\2.7.7\83cd2cd674a217ade95a4bb83a8a14f351f48bd0\antlr-2.7.7.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.2.3.Final\d3865101f0666b63586683bd811d754517f331ab\jandex-2.2.3.Final.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.dom4j\dom4j\2.1.3\a75914155a9f5808963170ec20653668a2ffd2fd\dom4j-2.1.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\5.3.9\887f4579ade4f47cf0102856f4f4c88eda8ec9d7\spring-context-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\2.5.3\26d822ee2bff03fb82e68c8a61be92f4994c9b56\spring-data-commons-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\5.3.9\db37587efd6525283b53c7adc8989095e9eabc27\spring-orm-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\5.3.9\a7057cf30368d014a1c8e5880a128703c890ec79\spring-tx-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\5.3.9\48600db2cb1abc0f7ef2b073f0c1abd78a83bcfc\spring-beans-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\2.5.3\f03d7e9102d93ab25110da850be9facf11818a0b\spring-boot-autoconfigure-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\2.5.3\e25d2de9e166a8bbbfae633fc03220ab36ac19a9\spring-boot-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\2.5.3\a3a2057be09b4105ecf2e7e3097e0e3fe2eb2684\spring-boot-starter-logging-2.5.3.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\1.3.5\59eb84ee0d616332ff44aba065f3888cf002cd2d\jakarta.annotation-api-1.3.5.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.28\7cae037c3014350c923776548e71c9feb7a69259\snakeyaml-1.28.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.sun.activation\jakarta.activation\1.2.2\74548703f9851017ce2f556066659438019e7eb5\jakarta.activation-1.2.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\5.3.9\f5ca763cfb9d62d196efd5d25e8daca7d555ed75\spring-expression-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\2.0.2\5eacc6522521f7eacb081f95cee1e231648461e7\jakarta.validation-api-2.0.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.12.4\b1174c05d4ded121a7eaeed3f148709f9585b981\jackson-datatype-jsr310-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.12.4\87c4e9a3302f0fafe4e5587f9c27d22847d8fe00\jackson-module-parameter-names-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.12.4\858a1e1b677cbafd3b100d5154f491a7051401c\jackson-datatype-jdk8-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\9.0.50\eb8d0bedeb2a9ed61ea3b3790055e937e52898a3\tomcat-embed-websocket-9.0.50.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\9.0.50\14307c487516ab3526213a1205c5243b0c484e8d\tomcat-embed-core-9.0.50.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.google.guava\guava\18.0\cce0823396aa693798f8882e64213b1772032b09\guava-18.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305\1.3.9\40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf\jsr305-1.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.mysema.commons\mysema-commons-lang\0.2.4\d09c8489d54251a6c22fbce804bdd4a070557317\mysema-commons-lang-0.2.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.infradna.tool\bridge-method-annotation\1.13\18cdce50cde6f54ee5390d0907384f72183ff0fe\bridge-method-annotation-1.13.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-oauth2-core\5.5.1\4bf6900ad4e532a384ea206ab16e9b4ebf7abfa3\spring-security-oauth2-core-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.nimbusds\oauth2-oidc-sdk\9.9\bdcd983f299a57aa61b11334f091958d3a4ff7f4\oauth2-oidc-sdk-9.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.nimbusds\nimbus-jose-jwt\9.10\9735ead6c97a8c7e43e414bfcb85eb40cae0f8ed\nimbus-jose-jwt-9.10.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-crypto\5.5.1\37ca67b6ff195b00bd29e65206c74017ca90239e\spring-security-crypto-5.5.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.12.4\752cf9a2562ac2c012e48057e3a4c17dad66c66e\jackson-annotations-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.12.4\6a1bd259b6c4e3f9219ec8ec0be55ed11eed0c\jackson-core-2.12.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\net.minidev\json-smart\2.4.7\8d7f4c1530c07c54930935f3da85f48b83b3c109\json-smart-2.4.7.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\1.2.2\99f53adba383cb1bf7c3862844488574b559621f\jakarta.activation-api-1.2.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-params\5.7.2\685f832f8c54dd40100f646d61aca88ed9545421\junit-jupiter-params-5.7.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-api\5.7.2\f4b4079732a9c537983324cfa4e46655f21d2c56\junit-jupiter-api-5.7.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy-agent\1.10.22\b01df6b71a882b9fde5a608a26e641cd399a4d83\byte-buddy-agent-1.10.22.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.objenesis\objenesis\3.2\7fadf57620c8b8abdf7519533e5527367cb51f09\objenesis-3.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.vaadin.external.google\android-json\0.0.20131108.vaadin1\fa26d351fe62a6a17f5cda1287c1c6110dec413f\android-json-0.0.20131108.vaadin1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\5.3.9\622eb12c98768b6d3acc71ce06bac8b332607a10\spring-jcl-5.3.9.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\2.3.4\257fa649d3137a1060d222aefb96b7d1dd5f1286\txw2-2.3.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\3.0.12\cbbe1a62b0cc6c85972e99d52aaee350153dc530\istack-commons-runtime-3.0.12.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.2.4\f3bc99fd0b226065012b24fe9f808299048bab54\logback-classic-1.2.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.14.1\ce8a86a3f50a4304749828ce68e7478cafbc8039\log4j-to-slf4j-2.14.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\1.7.32\8a055c04ab44e8e8326901cadf89080721348bdb\jul-to-slf4j-1.7.32.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.github.stephenc.jcip\jcip-annotations\1.0-1\ef31541dd28ae2cefdd17c7ebf352d93e9058c63\jcip-annotations-1.0-1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.nimbusds\content-type\2.1\66d618739859bc75ab9643b96a9839ac7802ec90\content-type-2.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.nimbusds\lang-tag\1.5\7e82e3c4c593f85addf4bd209abde4f8ff933a07\lang-tag-1.5.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\net.minidev\accessors-smart\2.4.7\3970cfc505e6657ca60f3aa57c849f6043000d7a\accessors-smart-2.4.7.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apiguardian\apiguardian-api\1.1.0\fc9dff4bb36d627bdc553de77e1f17efd790876c\apiguardian-api-1.1.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-commons\1.7.2\34adfea6c13fc4a996cf38cdad80800ce850d198\junit-platform-commons-1.7.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.opentest4j\opentest4j\1.2.0\28c11eb91f9b6d8e200631d46e20a7f407f2a046\opentest4j-1.2.0.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.2.4\5f429ee58dbacf9040f846f1218c36ca6e851596\logback-core-1.2.4.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.14.1\cd8858fbbde69f46bce8db1152c18a43328aae78\log4j-api-2.14.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.ow2.asm\asm\9.1\a99500cf6eea30535eeac6be73899d048f8d12a8\asm-9.1.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\com.h2database\h2\1.4.200\f7533fe7cb8e99c87a43d325a77b4b678ad9031a\h2-1.4.200.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\mysql\mysql-connector-java\8.0.26\e5ec6610020a3084b7d32ee725d1650176f6b3de\mysql-connector-java-8.0.26.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.jupiter\junit-jupiter-engine\5.7.2\9415680a889f00b8205a094c5c487bc69dc7077d\junit-jupiter-engine-5.7.2.jar;C:\Users\hbh\.gradle\caches\modules-2\files-2.1\org.junit.platform\junit-platform-engine\1.7.2\2573770b46b8a199ed5f6b0f96fb99e468bfe891\junit-platform-engine-1.7.2.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity
09:26:10.897 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
09:26:10.946 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
09:26:11.084 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity] from class [org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper]
09:26:11.126 [main] INFO org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity], using SpringBootContextLoader
09:26:11.141 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity]: class path resource [today/what_should_i_eat_today/domain/member/api/MemberApiTestSecurity-context.xml] does not exist
09:26:11.145 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity]: class path resource [today/what_should_i_eat_today/domain/member/api/MemberApiTestSecurityContext.groovy] does not exist
09:26:11.146 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity]: no resource found for suffixes {-context.xml, Context.groovy}.
09:26:11.148 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity]: MemberApiTestSecurity does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
09:26:11.966 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\project\what_should_i_eat_today_back\out\production\classes\today\what_should_i_eat_today\WhatShouldIEatTodayApplication.class]
09:26:11.969 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration today.what_should_i_eat_today.WhatShouldIEatTodayApplication for test class today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity
09:26:11.989 [main] DEBUG org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper - @TestExecutionListeners is not present for class [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity]: using defaults.
09:26:11.991 [main] INFO org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener, org.springframework.security.test.context.support.ReactorContextTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
09:26:12.065 [main] INFO org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@70e9c95d, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@4d5650ae, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@a38c7fe, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@6fdbe764, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@51c668e3, org.springframework.test.context.support.DirtiesContextTestExecutionListener@2e6a8155, org.springframework.test.context.transaction.TransactionalTestExecutionListener@6221a451, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@52719fb6, org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener@3012646b, org.springframework.test.context.event.EventPublishingTestExecutionListener@4a883b15, org.springframework.security.test.context.support.ReactorContextTestExecutionListener@25641d39, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@7b36aa0c, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@5824a83d, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@537f60bf, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@5677323c, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@18df8434, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@65c7a252]
09:26:12.074 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@60099951 testClass = MemberApiTestSecurity, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@20140db9 testClass = MemberApiTestSecurity, locations = '{}', classes = '{class today.what_should_i_eat_today.WhatShouldIEatTodayApplication}', contextInitializerClasses = '[]', activeProfiles = '{local}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory$DisableAutoConfigurationContextCustomizer@4218d6a3, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@71d44a3, org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer@c5a98750, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@d258b3ad, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@367ffa75, [ImportsContextCustomizer@1e6a3214 key = [org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration, org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration, org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration, org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration, org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration, org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration, org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration, org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration, org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration, org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration, org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration, org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration, org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration, org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration, org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration, org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration, org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration, org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@c0c2f8d, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@66d18979, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@42397fc5, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@0], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty]]], class annotated with @DirtiesContext [false] with mode [null].
09:26:12.242 [main] DEBUG org.springframework.core.env.StandardEnvironment - Activating profiles [local]
09:26:12.266 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTestContextBootstrapper=true}
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.3)
2021-08-19 09:26:13.395 INFO 12040 --- [ main] t.w.d.member.api.MemberApiTestSecurity : Starting MemberApiTestSecurity using Java 1.8.0_282 on DESKTOP-QM9O6OE with PID 12040 (started by hbh in C:\project\what_should_i_eat_today_back)
2021-08-19 09:26:13.396 INFO 12040 --- [ main] t.w.d.member.api.MemberApiTestSecurity : The following profiles are active: local
2021-08-19 09:26:16.212 INFO 12040 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@3bbf841e' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-08-19 09:26:16.315 INFO 12040 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-08-19 09:26:16.438 WARN 12040 --- [ main] o.s.w.c.s.GenericWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig' defined in file [C:\project\what_should_i_eat_today_back\out\production\classes\today\what_should_i_eat_today\global\config\SecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2021-08-19 09:26:16.447 INFO 12040 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-19 09:26:16.541 ERROR 12040 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in today.what_should_i_eat_today.global.config.SecurityConfig required a bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' that could not be found.
Action:
Consider defining a bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' in your configuration.
2021-08-19 09:26:16.568 ERROR 12040 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@6fdbe764] to prepare test instance [today.what_should_i_eat_today.domain.member.api.MemberApiTestSecurity@788ddc1f]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132) ~[spring-test-5.3.9.jar:5.3.9]
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124) ~[spring-test-5.3.9.jar:5.3.9]
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.postProcessFields(MockitoTestExecutionListener.java:110) ~[spring-boot-test-2.5.3.jar:2.5.3]
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.injectFields(MockitoTestExecutionListener.java:94) ~[spring-boot-test-2.5.3.jar:2.5.3]
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.prepareTestInstance(MockitoTestExecutionListener.java:61) ~[spring-boot-test-2.5.3.jar:2.5.3]
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244) ~[spring-test-5.3.9.jar:5.3.9]
at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138) [spring-test-5.3.9.jar:5.3.9]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:350) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:355) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$7(ClassBasedTestDescriptor.java:350) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_282]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[na:1.8.0_282]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[na:1.8.0_282]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_282]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_282]
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313) ~[na:1.8.0_282]
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) ~[na:1.8.0_282]
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742) ~[na:1.8.0_282]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) ~[na:1.8.0_282]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:349) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$4(ClassBasedTestDescriptor.java:270) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:269) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:259) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at java.util.Optional.orElseGet(Optional.java:267) ~[na:1.8.0_282]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:258) [junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) ~[junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:101) ~[junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:100) ~[junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:65) ~[junit-jupiter-engine-5.7.2.jar:5.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:111) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:111) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:79) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_282]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at java.util.ArrayList.forEach(ArrayList.java:1259) ~[na:1.8.0_282]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) ~[junit-platform-engine-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75) ~[junit-platform-launcher-1.7.2.jar:1.7.2]
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71) ~[junit5-rt.jar:na]
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) ~[junit-rt.jar:na]
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220) ~[junit-rt.jar:na]
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53) ~[junit-rt.jar:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig' defined in file [C:\project\what_should_i_eat_today_back\out\production\classes\today\what_should_i_eat_today\global\config\SecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.9.jar:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.9.jar:5.3.9]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.3.jar:2.5.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.3.jar:2.5.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.3.jar:2.5.3]
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:123) ~[spring-boot-test-2.5.3.jar:2.5.3]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) ~[spring-test-5.3.9.jar:5.3.9]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-5.3.9.jar:5.3.9]
... 68 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1790) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1346) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) ~[spring-beans-5.3.9.jar:5.3.9]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ~[spring-beans-5.3.9.jar:5.3.9]
... 86 common frames omitted
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.postProcessFields(MockitoTestExecutionListener.java:110)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.injectFields(MockitoTestExecutionListener.java:94)
at org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener.prepareTestInstance(MockitoTestExecutionListener.java:61)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)
at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:350)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:355)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$7(ClassBasedTestDescriptor.java:350)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:313)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743)
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:349)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$4(ClassBasedTestDescriptor.java:270)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:269)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:259)
at java.util.Optional.orElseGet(Optional.java:267)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:258)
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:101)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:100)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:65)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:111)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:111)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:79)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfig' defined in file [C:\project\what_should_i_eat_today_back\out\production\classes\today\what_should_i_eat_today\global\config\SecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:123)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
... 68 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'today.what_should_i_eat_today.global.security.CustomUserDetailsService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1346)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 86 more
Process finished with exit code -1
이유2
Security Config 을 적용하지 않았기 때문에 발생하는 오류이다
해결2
방법1 (안정적이지만 느림)
@SpringBootTest
class UserControllerTest {
private MockMvc mvc;
@MockBean
private UserService userService;
@BeforeEach
void setUp(@Autowired WebApplicationContext context) {
mvc = MockMvcBuilders.webAppContextSetup(context)
.apply(springSecurity())
.build();
}
@Test
@WithMockUser
void test() throws Exception {
given(userService.findById(1L)).willReturn(User.builder().id(1L).name("martin").build());
mvc.perform(get("/api/members/1"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value("martin"))
;
}
}
현재 프로젝트에는 QueryDsl 도 사용되어서 복잡한 설정들이 얽혀 있는 경우 어떤 것들을 bean 으로 설정해야하는 지 어려워질 수 있기 때문에 모를 때는 그냥 전부 띄우는게 안정적이고, 간편하다
방법2 (나름 빠름)
@ExtendWith(value = {SpringExtension.class})
@AutoConfigureDataJpa
@ComponentScan(basePackages = "com.example.demo.security") // 커스텀한 security 패키지 주소
@WebMvcTest(controllers = UserController.class)
class UserControllerTest {
@Autowired
private MockMvc mvc;
@MockBean
private UserService userService;
@Test
@WithMockUser
void test() throws Exception {
given(userService.findById(1L)).willReturn(User.builder().id(1L).name("martin").build());
mvc.perform(get("/api/members/1"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value("martin"))
;
}
}
방법3 (비추 - 오류나는 Bean 직접 다 입력해야함...)
@ExtendWith(value = {SpringExtension.class})
@AutoConfigureDataJpa
@Import(value = {CustomOAuth2UserService.class, CustomUserDetailsService.class}) // 오류 뜨는 클래스를 계속 추가하면 됩니다..
@WebMvcTest(controllers = UserController.class,
includeFilters = {
@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = SecurityConfig.class)
}
)
class UserControllerTest {
@Autowired
private MockMvc mvc;
@MockBean
private UserService userService;
@Test
@WithMockUser
void test() throws Exception {
given(userService.findById(1L)).willReturn(User.builder().id(1L).name("martin").build());
mvc.perform(get("/api/members/1"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.name").value("martin"))
;
}
}
@ContextConfiguration(classes = CustomUserDetailsService.class) 으로도 context 에 bean 으로등록하는 방법도 있긴하다
정리
- @AutoConfigureDataJpa
- JPA 를 이용하여 DB 에 접근하는 경우가 있을 때 자동으로 설정하게 해주는 어노테이션이다 → Spring Security 에서 커스텀 인증 필터에서 UserDetailsServiceImpl 를 구현하여 JPA 를 사용하여 DB 에 넣어주기 때문에 사용하였다 코드가 실행되면서 JPA 코드를 사용하는 경우가 없는 경우에는 안적어줘도 된다
- @Import
- 원하는 컴포넌트 클래스들만 직접 입력하여 Bean 으로 사용한다
- @ComponentScan
- 원하는 패키지에 있는 컴포넌트를 모두 Bean 으로 사용한다
참고
'∞. 트러블 슈팅 + TIL' 카테고리의 다른 글
07. Spring Security TestRestTemaplte PatchMapping 오류 (0) | 2021.09.08 |
---|---|
05. Spring Boot 2.4 Test 와 Profile (0) | 2021.09.08 |
04. Spring Boot 2.4 Profile 적용 안되던 문제 (2) | 2021.09.08 |
03. Spring Boot 2.x CrossOrigin 문제 (0) | 2021.09.08 |
02. JPA Querydsl cannot find symbol 에러 (0) | 2021.09.08 |
댓글
이 글 공유하기
다른 글
-
07. Spring Security TestRestTemaplte PatchMapping 오류
07. Spring Security TestRestTemaplte PatchMapping 오류
2021.09.08 -
05. Spring Boot 2.4 Test 와 Profile
05. Spring Boot 2.4 Test 와 Profile
2021.09.08 -
04. Spring Boot 2.4 Profile 적용 안되던 문제
04. Spring Boot 2.4 Profile 적용 안되던 문제
2021.09.08 -
03. Spring Boot 2.x CrossOrigin 문제
03. Spring Boot 2.x CrossOrigin 문제
2021.09.08