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
d8e39606
Commit
d8e39606
authored
Nov 17, 2017
by
Vedran Pavic
Committed by
Andy Wilkinson
Nov 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Spring Session auto-configuration tests
Closes gh-11063
parent
b7753a1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
AbstractSessionAutoConfigurationTests.java
...figure/session/AbstractSessionAutoConfigurationTests.java
+5
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/AbstractSessionAutoConfigurationTests.java
View file @
d8e39606
...
@@ -21,11 +21,13 @@ import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplic
...
@@ -21,11 +21,13 @@ import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplic
import
org.springframework.boot.test.context.assertj.AssertableWebApplicationContext
;
import
org.springframework.boot.test.context.assertj.AssertableWebApplicationContext
;
import
org.springframework.session.ReactiveSessionRepository
;
import
org.springframework.session.ReactiveSessionRepository
;
import
org.springframework.session.SessionRepository
;
import
org.springframework.session.SessionRepository
;
import
org.springframework.session.web.http.SessionRepositoryFilter
;
import
org.springframework.web.server.session.WebSessionManager
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Share test utilities for {@link SessionAutoConfiguration} tests.
* Share
d
test utilities for {@link SessionAutoConfiguration} tests.
*
*
* @author Stephane Nicoll
* @author Stephane Nicoll
*/
*/
...
@@ -33,6 +35,7 @@ public abstract class AbstractSessionAutoConfigurationTests {
...
@@ -33,6 +35,7 @@ public abstract class AbstractSessionAutoConfigurationTests {
protected
<
T
extends
SessionRepository
<?>>
T
validateSessionRepository
(
protected
<
T
extends
SessionRepository
<?>>
T
validateSessionRepository
(
AssertableWebApplicationContext
context
,
Class
<
T
>
type
)
{
AssertableWebApplicationContext
context
,
Class
<
T
>
type
)
{
assertThat
(
context
).
hasSingleBean
(
SessionRepositoryFilter
.
class
);
assertThat
(
context
).
hasSingleBean
(
SessionRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
SessionRepository
.
class
);
SessionRepository
<?>
repository
=
context
.
getBean
(
SessionRepository
.
class
);
SessionRepository
<?>
repository
=
context
.
getBean
(
SessionRepository
.
class
);
assertThat
(
repository
).
as
(
"Wrong session repository type"
).
isInstanceOf
(
type
);
assertThat
(
repository
).
as
(
"Wrong session repository type"
).
isInstanceOf
(
type
);
...
@@ -46,6 +49,7 @@ public abstract class AbstractSessionAutoConfigurationTests {
...
@@ -46,6 +49,7 @@ public abstract class AbstractSessionAutoConfigurationTests {
protected
<
T
extends
ReactiveSessionRepository
<?>>
T
validateSessionRepository
(
protected
<
T
extends
ReactiveSessionRepository
<?>>
T
validateSessionRepository
(
AssertableReactiveWebApplicationContext
context
,
Class
<
T
>
type
)
{
AssertableReactiveWebApplicationContext
context
,
Class
<
T
>
type
)
{
assertThat
(
context
).
hasSingleBean
(
WebSessionManager
.
class
);
assertThat
(
context
).
hasSingleBean
(
ReactiveSessionRepository
.
class
);
assertThat
(
context
).
hasSingleBean
(
ReactiveSessionRepository
.
class
);
ReactiveSessionRepository
<?>
repository
=
context
ReactiveSessionRepository
<?>
repository
=
context
.
getBean
(
ReactiveSessionRepository
.
class
);
.
getBean
(
ReactiveSessionRepository
.
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