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
02a1c435
Commit
02a1c435
authored
Nov 29, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
decaacdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
ServletEndpointManagementContextConfigurationTests.java
...b/ServletEndpointManagementContextConfigurationTests.java
+8
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java
View file @
02a1c435
...
@@ -24,6 +24,7 @@ import org.junit.Test;
...
@@ -24,6 +24,7 @@ import org.junit.Test;
import
org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar
;
import
org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar
;
import
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier
;
import
org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
;
import
org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath
;
import
org.springframework.boot.autoconfigure.web.servlet.JerseyApplicationPath
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.test.context.FilteredClassLoader
;
import
org.springframework.boot.test.context.FilteredClassLoader
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
...
@@ -60,7 +61,7 @@ public class ServletEndpointManagementContextConfigurationTests {
...
@@ -60,7 +61,7 @@ public class ServletEndpointManagementContextConfigurationTests {
}
}
@Test
@Test
public
void
servletPathShouldNotAffectJerseyConfiguration
()
{
public
void
contextWhenJerseyShouldContainServletEndpointRegistrar
()
{
FilteredClassLoader
classLoader
=
new
FilteredClassLoader
(
FilteredClassLoader
classLoader
=
new
FilteredClassLoader
(
DispatcherServlet
.
class
);
DispatcherServlet
.
class
);
this
.
contextRunner
.
withClassLoader
(
classLoader
).
run
((
context
)
->
{
this
.
contextRunner
.
withClassLoader
(
classLoader
).
run
((
context
)
->
{
...
@@ -68,7 +69,7 @@ public class ServletEndpointManagementContextConfigurationTests {
...
@@ -68,7 +69,7 @@ public class ServletEndpointManagementContextConfigurationTests {
ServletEndpointRegistrar
bean
=
context
ServletEndpointRegistrar
bean
=
context
.
getBean
(
ServletEndpointRegistrar
.
class
);
.
getBean
(
ServletEndpointRegistrar
.
class
);
String
basePath
=
(
String
)
ReflectionTestUtils
.
getField
(
bean
,
"basePath"
);
String
basePath
=
(
String
)
ReflectionTestUtils
.
getField
(
bean
,
"basePath"
);
assertThat
(
basePath
).
isEqualTo
(
"/actuator"
);
assertThat
(
basePath
).
isEqualTo
(
"/
jersey/
actuator"
);
});
});
}
}
...
@@ -94,6 +95,11 @@ public class ServletEndpointManagementContextConfigurationTests {
...
@@ -94,6 +95,11 @@ public class ServletEndpointManagementContextConfigurationTests {
return
()
->
"/test"
;
return
()
->
"/test"
;
}
}
@Bean
public
JerseyApplicationPath
jerseyApplicationPath
()
{
return
()
->
"/jersey"
;
}
}
}
}
}
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