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
67998e98
Commit
67998e98
authored
Feb 28, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Include WebSecurityConfigurer beans in @WebMvcTest"
This reverts commit
eef6fdb0
.
parent
6f06422d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
22 deletions
+2
-22
WebMvcTypeExcludeFilter.java
...st/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java
+1
-12
WebMvcTypeExcludeFilterTests.java
...toconfigure/web/servlet/WebMvcTypeExcludeFilterTests.java
+1
-10
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilter.java
View file @
67998e98
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -33,7 +33,6 @@ import org.springframework.core.convert.converter.Converter;
import
org.springframework.core.convert.converter.GenericConverter
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.ControllerAdvice
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
...
...
@@ -46,9 +45,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
*/
class
WebMvcTypeExcludeFilter
extends
AnnotationCustomizableTypeExcludeFilter
{
private
static
final
String
[]
OPTIONAL_INCLUDES
=
{
"org.springframework.security.config.annotation.web.WebSecurityConfigurer"
};
private
static
final
Set
<
Class
<?>>
DEFAULT_INCLUDES
;
static
{
...
...
@@ -64,13 +60,6 @@ class WebMvcTypeExcludeFilter extends AnnotationCustomizableTypeExcludeFilter {
includes
.
add
(
ErrorAttributes
.
class
);
includes
.
add
(
Converter
.
class
);
includes
.
add
(
GenericConverter
.
class
);
for
(
String
optionalInclude
:
OPTIONAL_INCLUDES
)
{
try
{
includes
.
add
(
ClassUtils
.
forName
(
optionalInclude
,
null
));
}
catch
(
Exception
ex
)
{
}
}
DEFAULT_INCLUDES
=
Collections
.
unmodifiableSet
(
includes
);
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/WebMvcTypeExcludeFilterTests.java
View file @
67998e98
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -26,7 +26,6 @@ import org.springframework.core.type.classreading.MetadataReader;
import
org.springframework.core.type.classreading.MetadataReaderFactory
;
import
org.springframework.core.type.classreading.SimpleMetadataReaderFactory
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Service
;
...
...
@@ -55,7 +54,6 @@ public class WebMvcTypeExcludeFilterTests {
assertThat
(
excludes
(
filter
,
ExampleMessageConverter
.
class
)).
isFalse
();
assertThat
(
excludes
(
filter
,
ExampleService
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleRepository
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleWebSecurityConfigurer
.
class
)).
isFalse
();
}
@Test
...
...
@@ -69,7 +67,6 @@ public class WebMvcTypeExcludeFilterTests {
assertThat
(
excludes
(
filter
,
ExampleMessageConverter
.
class
)).
isFalse
();
assertThat
(
excludes
(
filter
,
ExampleService
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleRepository
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleWebSecurityConfigurer
.
class
)).
isFalse
();
}
@Test
...
...
@@ -83,7 +80,6 @@ public class WebMvcTypeExcludeFilterTests {
assertThat
(
excludes
(
filter
,
ExampleMessageConverter
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleService
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleRepository
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleWebSecurityConfigurer
.
class
)).
isTrue
();
}
@Test
...
...
@@ -110,7 +106,6 @@ public class WebMvcTypeExcludeFilterTests {
assertThat
(
excludes
(
filter
,
ExampleMessageConverter
.
class
)).
isFalse
();
assertThat
(
excludes
(
filter
,
ExampleService
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleRepository
.
class
)).
isTrue
();
assertThat
(
excludes
(
filter
,
ExampleWebSecurityConfigurer
.
class
)).
isFalse
();
}
private
boolean
excludes
(
WebMvcTypeExcludeFilter
filter
,
Class
<?>
type
)
...
...
@@ -178,8 +173,4 @@ public class WebMvcTypeExcludeFilterTests {
}
static
class
ExampleWebSecurityConfigurer
extends
WebSecurityConfigurerAdapter
{
}
}
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