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
d91c71b5
Commit
d91c71b5
authored
Aug 29, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate secure flag on @WebMvcTest
Closes gh-14227
parent
174f53e1
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
58 additions
and
16 deletions
+58
-16
AutoConfigureMockMvc.java
.../test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
+2
-0
MockMvcWebDriverAutoConfiguration.java
...figure/web/servlet/MockMvcWebDriverAutoConfiguration.java
+13
-1
WebMvcTest.java
...ework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
+2
-0
MockMvcRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java
...toConfigurationAdvancedConfigurationIntegrationTests.java
+1
-1
WebMvcTestAllControllersIntegrationTests.java
...let/mockmvc/WebMvcTestAllControllersIntegrationTests.java
+3
-1
WebMvcTestConverterIntegrationTests.java
.../servlet/mockmvc/WebMvcTestConverterIntegrationTests.java
+3
-1
WebMvcTestCustomDispatcherServletIntegrationTests.java
...vc/WebMvcTestCustomDispatcherServletIntegrationTests.java
+3
-1
WebMvcTestHateoasIntegrationTests.java
...eb/servlet/mockmvc/WebMvcTestHateoasIntegrationTests.java
+3
-1
WebMvcTestMessageSourceIntegrationTests.java
...vlet/mockmvc/WebMvcTestMessageSourceIntegrationTests.java
+3
-1
WebMvcTestOneControllerIntegrationTests.java
...vlet/mockmvc/WebMvcTestOneControllerIntegrationTests.java
+3
-1
WebMvcTestPageableIntegrationTests.java
...b/servlet/mockmvc/WebMvcTestPageableIntegrationTests.java
+3
-1
WebMvcTestPrintAlwaysIntegrationTests.java
...ervlet/mockmvc/WebMvcTestPrintAlwaysIntegrationTests.java
+3
-1
WebMvcTestPrintDefaultIntegrationTests.java
...rvlet/mockmvc/WebMvcTestPrintDefaultIntegrationTests.java
+3
-1
WebMvcTestPrintDefaultOverrideIntegrationTests.java
...ckmvc/WebMvcTestPrintDefaultOverrideIntegrationTests.java
+3
-1
WebMvcTestPrintOverrideIntegrationTests.java
...vlet/mockmvc/WebMvcTestPrintOverrideIntegrationTests.java
+3
-1
WebMvcTestWebClientIntegrationTests.java
.../servlet/mockmvc/WebMvcTestWebClientIntegrationTests.java
+3
-1
WebMvcTestWebDriverCustomScopeIntegrationTests.java
...ckmvc/WebMvcTestWebDriverCustomScopeIntegrationTests.java
+1
-1
WebMvcTestWebDriverIntegrationTests.java
.../servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java
+3
-1
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/AutoConfigureMockMvc.java
View file @
d91c71b5
...
@@ -89,7 +89,9 @@ public @interface AutoConfigureMockMvc {
...
@@ -89,7 +89,9 @@ public @interface AutoConfigureMockMvc {
* If Spring Security's {@link MockMvc} support should be auto-configured when it is
* If Spring Security's {@link MockMvc} support should be auto-configured when it is
* on the classpath. Defaults to {@code true}.
* on the classpath. Defaults to {@code true}.
* @return if Spring Security's MockMvc support is auto-configured
* @return if Spring Security's MockMvc support is auto-configured
* @deprecated since 2.1.0 in favor of Spring Security's testing support
*/
*/
@Deprecated
boolean
secure
()
default
true
;
boolean
secure
()
default
true
;
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/MockMvcWebDriverAutoConfiguration.java
View file @
d91c71b5
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
web
.
servlet
;
package
org
.
springframework
.
boot
.
test
.
autoconfigure
.
web
.
servlet
;
import
java.util.concurrent.Executors
;
import
com.gargoylesoftware.htmlunit.BrowserVersion
;
import
com.gargoylesoftware.htmlunit.BrowserVersion
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.htmlunit.HtmlUnitDriver
;
import
org.openqa.selenium.htmlunit.HtmlUnitDriver
;
...
@@ -29,8 +31,10 @@ import org.springframework.boot.test.web.htmlunit.webdriver.LocalHostWebConnecti
...
@@ -29,8 +31,10 @@ import org.springframework.boot.test.web.htmlunit.webdriver.LocalHostWebConnecti
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.security.concurrent.DelegatingSecurityContextExecutor
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
;
import
org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
;
import
org.springframework.util.ClassUtils
;
/**
/**
* Auto-configuration for Selenium {@link WebDriver} MockMVC integration.
* Auto-configuration for Selenium {@link WebDriver} MockMVC integration.
...
@@ -46,6 +50,8 @@ public class MockMvcWebDriverAutoConfiguration {
...
@@ -46,6 +50,8 @@ public class MockMvcWebDriverAutoConfiguration {
private
final
Environment
environment
;
private
final
Environment
environment
;
private
static
final
String
SECURITY_CONTEXT_EXECUTOR
=
"org.springframework.security.concurrent.DelegatingSecurityContextExecutor"
;
MockMvcWebDriverAutoConfiguration
(
Environment
environment
)
{
MockMvcWebDriverAutoConfiguration
(
Environment
environment
)
{
this
.
environment
=
environment
;
this
.
environment
=
environment
;
}
}
...
@@ -63,7 +69,13 @@ public class MockMvcWebDriverAutoConfiguration {
...
@@ -63,7 +69,13 @@ public class MockMvcWebDriverAutoConfiguration {
@ConditionalOnMissingBean
(
WebDriver
.
class
)
@ConditionalOnMissingBean
(
WebDriver
.
class
)
@ConditionalOnBean
(
MockMvcHtmlUnitDriverBuilder
.
class
)
@ConditionalOnBean
(
MockMvcHtmlUnitDriverBuilder
.
class
)
public
HtmlUnitDriver
htmlUnitDriver
(
MockMvcHtmlUnitDriverBuilder
builder
)
{
public
HtmlUnitDriver
htmlUnitDriver
(
MockMvcHtmlUnitDriverBuilder
builder
)
{
return
builder
.
build
();
HtmlUnitDriver
driver
=
builder
.
build
();
if
(
ClassUtils
.
isPresent
(
SECURITY_CONTEXT_EXECUTOR
,
getClass
().
getClassLoader
()))
{
driver
.
setExecutor
(
new
DelegatingSecurityContextExecutor
(
Executors
.
newSingleThreadExecutor
()));
}
return
driver
;
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTest.java
View file @
d91c71b5
...
@@ -143,7 +143,9 @@ public @interface WebMvcTest {
...
@@ -143,7 +143,9 @@ public @interface WebMvcTest {
* If Spring Security's {@link MockMvc} support should be auto-configured when it is
* If Spring Security's {@link MockMvc} support should be auto-configured when it is
* on the classpath. Defaults to {@code true}.
* on the classpath. Defaults to {@code true}.
* @return if Spring Security's MockMvc support is auto-configured
* @return if Spring Security's MockMvc support is auto-configured
* @deprecated since 2.1.0 in favor of Spring Security's testing support
*/
*/
@Deprecated
@AliasFor
(
annotation
=
AutoConfigureMockMvc
.
class
)
@AliasFor
(
annotation
=
AutoConfigureMockMvc
.
class
)
boolean
secure
()
default
true
;
boolean
secure
()
default
true
;
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/restdocs/MockMvcRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests.java
View file @
d91c71b5
...
@@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
...
@@ -49,7 +49,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
* @author Eddú Meléndez
* @author Eddú Meléndez
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
controllers
=
RestDocsTestController
.
class
,
secure
=
false
)
@WebMvcTest
(
controllers
=
RestDocsTestController
.
class
)
@AutoConfigureRestDocs
@AutoConfigureRestDocs
public
class
MockMvcRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests
{
public
class
MockMvcRestDocsAutoConfigurationAdvancedConfigurationIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestAllControllersIntegrationTests.java
View file @
d91c71b5
...
@@ -26,6 +26,7 @@ import org.junit.runner.RunWith;
...
@@ -26,6 +26,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.web.servlet.error.ErrorAttributes
;
import
org.springframework.boot.web.servlet.error.ErrorAttributes
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -42,7 +43,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -42,7 +43,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
public
class
WebMvcTestAllControllersIntegrationTests
{
public
class
WebMvcTestAllControllersIntegrationTests
{
@Rule
@Rule
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestConverterIntegrationTests.java
View file @
d91c71b5
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -36,7 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -36,7 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
controllers
=
ExampleController2
.
class
,
secure
=
false
)
@WebMvcTest
(
controllers
=
ExampleController2
.
class
)
@WithMockUser
public
class
WebMvcTestConverterIntegrationTests
{
public
class
WebMvcTestConverterIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestCustomDispatcherServletIntegrationTests.java
View file @
d91c71b5
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -36,7 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -36,7 +37,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
@TestPropertySource
(
properties
=
{
"spring.mvc.throw-exception-if-no-handler-found=true"
,
@TestPropertySource
(
properties
=
{
"spring.mvc.throw-exception-if-no-handler-found=true"
,
"spring.mvc.static-path-pattern=/static/**"
})
"spring.mvc.static-path-pattern=/static/**"
})
public
class
WebMvcTestCustomDispatcherServletIntegrationTests
{
public
class
WebMvcTestCustomDispatcherServletIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestHateoasIntegrationTests.java
View file @
d91c71b5
...
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith;
...
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
public
class
WebMvcTestHateoasIntegrationTests
{
public
class
WebMvcTestHateoasIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestMessageSourceIntegrationTests.java
View file @
d91c71b5
...
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.MessageSource
;
import
org.springframework.context.MessageSource
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
@@ -36,7 +37,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -36,7 +37,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Andy Wilkinson
* @author Andy Wilkinson
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
@TestPropertySource
(
properties
=
"spring.messages.basename=web-test-messages"
)
@TestPropertySource
(
properties
=
"spring.messages.basename=web-test-messages"
)
public
class
WebMvcTestMessageSourceIntegrationTests
{
public
class
WebMvcTestMessageSourceIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestOneControllerIntegrationTests.java
View file @
d91c71b5
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
controllers
=
ExampleController2
.
class
,
secure
=
false
)
@WebMvcTest
(
controllers
=
ExampleController2
.
class
)
@WithMockUser
public
class
WebMvcTestOneControllerIntegrationTests
{
public
class
WebMvcTestOneControllerIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestPageableIntegrationTests.java
View file @
d91c71b5
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
...
@@ -21,6 +21,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -34,7 +35,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
public
class
WebMvcTestPageableIntegrationTests
{
public
class
WebMvcTestPageableIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestPrintAlwaysIntegrationTests.java
View file @
d91c71b5
...
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -39,7 +40,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -39,7 +40,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
@WebMvcTest
@AutoConfigureMockMvc
(
secure
=
false
,
printOnlyOnFailure
=
false
)
@WithMockUser
@AutoConfigureMockMvc
(
printOnlyOnFailure
=
false
)
public
class
WebMvcTestPrintAlwaysIntegrationTests
{
public
class
WebMvcTestPrintAlwaysIntegrationTests
{
@Rule
@Rule
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestPrintDefaultIntegrationTests.java
View file @
d91c71b5
...
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith;
...
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
request
.
MockMvcRequestBuilders
.
get
;
...
@@ -35,7 +36,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -35,7 +36,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
*/
@RunWith
(
WebMvcTestPrintDefaultRunner
.
class
)
@RunWith
(
WebMvcTestPrintDefaultRunner
.
class
)
@WebMvcTest
@WebMvcTest
@AutoConfigureMockMvc
(
secure
=
false
)
@WithMockUser
@AutoConfigureMockMvc
public
class
WebMvcTestPrintDefaultIntegrationTests
{
public
class
WebMvcTestPrintDefaultIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestPrintDefaultOverrideIntegrationTests.java
View file @
d91c71b5
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -38,7 +39,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -38,7 +39,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
@TestPropertySource
(
properties
=
"spring.test.mockmvc.print=NONE"
)
@TestPropertySource
(
properties
=
"spring.test.mockmvc.print=NONE"
)
public
class
WebMvcTestPrintDefaultOverrideIntegrationTests
{
public
class
WebMvcTestPrintDefaultOverrideIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestPrintOverrideIntegrationTests.java
View file @
d91c71b5
...
@@ -25,6 +25,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
...
@@ -25,6 +25,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
import
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrint
;
import
org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrint
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.boot.test.rule.OutputCapture
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.MockMvc
;
...
@@ -40,7 +41,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
...
@@ -40,7 +41,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
@WebMvcTest
@AutoConfigureMockMvc
(
secure
=
false
,
print
=
MockMvcPrint
.
NONE
)
@WithMockUser
@AutoConfigureMockMvc
(
print
=
MockMvcPrint
.
NONE
)
public
class
WebMvcTestPrintOverrideIntegrationTests
{
public
class
WebMvcTestPrintOverrideIntegrationTests
{
@Rule
@Rule
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebClientIntegrationTests.java
View file @
d91c71b5
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
...
@@ -23,6 +23,7 @@ import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -33,7 +34,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -33,7 +34,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
public
class
WebMvcTestWebClientIntegrationTests
{
public
class
WebMvcTestWebClientIntegrationTests
{
@Autowired
@Autowired
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverCustomScopeIntegrationTests.java
View file @
d91c71b5
...
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
public
class
WebMvcTestWebDriverCustomScopeIntegrationTests
{
public
class
WebMvcTestWebDriverCustomScopeIntegrationTests
{
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/WebMvcTestWebDriverIntegrationTests.java
View file @
d91c71b5
...
@@ -27,6 +27,7 @@ import org.openqa.selenium.WebElement;
...
@@ -27,6 +27,7 @@ import org.openqa.selenium.WebElement;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
;
import
org.springframework.security.test.context.support.WithMockUser
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
org.springframework.test.util.ReflectionTestUtils
;
...
@@ -39,7 +40,8 @@ import static org.junit.Assert.fail;
...
@@ -39,7 +40,8 @@ import static org.junit.Assert.fail;
* @author Phillip Webb
* @author Phillip Webb
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@WebMvcTest
(
secure
=
false
)
@WebMvcTest
@WithMockUser
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
@FixMethodOrder
(
MethodSorters
.
NAME_ASCENDING
)
public
class
WebMvcTestWebDriverIntegrationTests
{
public
class
WebMvcTestWebDriverIntegrationTests
{
...
...
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