Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
0a377647
Commit
0a377647
authored
Feb 04, 2020
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import OAuth2 auto-configurations in web slice tests
Fixes gh-19823
parent
60f5bb16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
spring.factories
...utoconfigure/src/main/resources/META-INF/spring.factories
+4
-0
WebFluxTestAutoConfigurationIntegrationTests.java
...bclient/WebFluxTestAutoConfigurationIntegrationTests.java
+15
-1
WebMvcTestAutoConfigurationIntegrationTests.java
.../servlet/WebMvcTestAutoConfigurationIntegrationTests.java
+14
-1
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring.factories
View file @
0a377647
...
@@ -88,6 +88,8 @@ org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
...
@@ -88,6 +88,8 @@ org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration
# AutoConfigureWebClient auto-configuration imports
# AutoConfigureWebClient auto-configuration imports
org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient=\
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.ReactiveSecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.reactive.ReactiveUserDetailsServiceAutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration
org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration
...
@@ -108,6 +110,8 @@ org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc=\
...
@@ -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.MockMvcAutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration,\
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.SecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration,\
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration,\
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityConfiguration
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/WebFluxTestAutoConfigurationIntegrationTests.java
View file @
0a377647
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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;
...
@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
;
import
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
;
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.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
;
import
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration
;
import
org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration
;
...
@@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
...
@@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Artsiom Yudovin
* @author Artsiom Yudovin
* @author Ali Dehghani
* @author Ali Dehghani
* @author Madhura Bhave
*/
*/
@WebFluxTest
@WebFluxTest
class
WebFluxTestAutoConfigurationIntegrationTests
{
class
WebFluxTestAutoConfigurationIntegrationTests
{
...
@@ -74,4 +77,15 @@ class WebFluxTestAutoConfigurationIntegrationTests {
...
@@ -74,4 +77,15 @@ class WebFluxTestAutoConfigurationIntegrationTests {
assertThat
(
this
.
applicationContext
).
has
(
importedAutoConfiguration
(
ErrorWebFluxAutoConfiguration
.
class
));
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
));
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTestAutoConfigurationIntegrationTests.java
View file @
0a377647
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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;
...
@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
;
import
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration
;
import
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration
;
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.task.TaskExecutionAutoConfiguration
;
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
...
@@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
...
@@ -37,6 +39,7 @@ import static org.springframework.boot.test.autoconfigure.AutoConfigurationImpor
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Levi Puot Paul
* @author Levi Puot Paul
* @author Madhura Bhave
*/
*/
@WebMvcTest
@WebMvcTest
class
WebMvcTestAutoConfigurationIntegrationTests
{
class
WebMvcTestAutoConfigurationIntegrationTests
{
...
@@ -76,4 +79,14 @@ class WebMvcTestAutoConfigurationIntegrationTests {
...
@@ -76,4 +79,14 @@ class WebMvcTestAutoConfigurationIntegrationTests {
"taskExecutor"
)).
isSameAs
(
this
.
applicationContext
.
getBean
(
"applicationTaskExecutor"
));
"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
));
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment