Import OAuth2 auto-configurations in web slice tests
Fixes gh-19823
This commit is contained in:
parent
60f5bb1636
commit
0a377647ca
|
|
@ -88,6 +88,8 @@ org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
|
|||
|
||||
# AutoConfigureWebClient auto-configuration imports
|
||||
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient=\
|
||||
org.springframework.boot.autoconfigure.security.oauth2.client.reactive.ReactiveOAuth2ClientAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.security.oauth2.resource.reactive.ReactiveOAuth2ResourceServerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.security.reactive.ReactiveSecurityAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfiguration,\
|
||||
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration
|
||||
|
|
@ -108,6 +110,8 @@ org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\
|
|||
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.UserDetailsServiceAutoConfiguration,\
|
||||
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.client.reactive.ReactiveOAuth2ClientAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.resource.reactive.ReactiveOAuth2ResourceServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
|
||||
|
|
@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
|
|||
* @author Stephane Nicoll
|
||||
* @author Artsiom Yudovin
|
||||
* @author Ali Dehghani
|
||||
* @author Madhura Bhave
|
||||
*/
|
||||
@WebFluxTest
|
||||
class WebFluxTestAutoConfigurationIntegrationTests {
|
||||
|
|
@ -74,4 +77,15 @@ class WebFluxTestAutoConfigurationIntegrationTests {
|
|||
assertThat(this.applicationContext).has(importedAutoConfiguration(ErrorWebFluxAutoConfiguration.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void oAuth2ClientAutoConfigurationWasImported() {
|
||||
assertThat(this.applicationContext).has(importedAutoConfiguration(ReactiveOAuth2ClientAutoConfiguration.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void oAuth2ResourceServerAutoConfigurationWasImported() {
|
||||
assertThat(this.applicationContext)
|
||||
.has(importedAutoConfiguration(ReactiveOAuth2ResourceServerAutoConfiguration.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.security.oauth2.resource.servlet.OAuth2ResourceServerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
|
@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
|
|||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Levi Puot Paul
|
||||
* @author Madhura Bhave
|
||||
*/
|
||||
@WebMvcTest
|
||||
class WebMvcTestAutoConfigurationIntegrationTests {
|
||||
|
|
@ -76,4 +79,14 @@ class WebMvcTestAutoConfigurationIntegrationTests {
|
|||
"taskExecutor")).isSameAs(this.applicationContext.getBean("applicationTaskExecutor"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void oAuth2ClientAutoConfigurationWasImported() {
|
||||
assertThat(this.applicationContext).has(importedAutoConfiguration(OAuth2ClientAutoConfiguration.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void oAuth2ResourceServerAutoConfigurationWasImported() {
|
||||
assertThat(this.applicationContext).has(importedAutoConfiguration(OAuth2ResourceServerAutoConfiguration.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue