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
35c6dc4e
Commit
35c6dc4e
authored
Nov 29, 2017
by
petar.tahchiev
Committed by
Stephane Nicoll
Nov 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NullPointer when requesting a session that does not exist
See gh-11202
parent
6cae9257
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
SessionsEndpoint.java
...pringframework/boot/actuate/session/SessionsEndpoint.java
+3
-0
SessionsEndpointWebIntegrationTests.java
.../actuate/session/SessionsEndpointWebIntegrationTests.java
+6
-0
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java
View file @
35c6dc4e
...
...
@@ -60,6 +60,9 @@ public class SessionsEndpoint {
@ReadOperation
public
SessionDescriptor
getSession
(
@Selector
String
sessionId
)
{
Session
session
=
this
.
sessionRepository
.
findById
(
sessionId
);
if
(
session
==
null
)
{
return
null
;
}
return
new
SessionDescriptor
(
session
);
}
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/session/SessionsEndpointWebIntegrationTests.java
View file @
35c6dc4e
...
...
@@ -80,6 +80,12 @@ public class SessionsEndpointWebIntegrationTests {
.
isEqualTo
(
new
JSONArray
().
appendElement
(
session
.
getId
()));
}
@Test
public
void
sessionForIdNotFound
()
{
client
.
get
().
uri
((
builder
)
->
builder
.
path
(
"/actuator/sessions/some-session-id-that-does-not-exist"
)
.
build
()).
exchange
().
expectStatus
().
isNotFound
();
}
@Configuration
protected
static
class
TestConfiguration
{
...
...
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