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
12cb478b
Commit
12cb478b
authored
Oct 05, 2018
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore files changes by accident
parent
1d8e4a8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
pom.xml
spring-boot-samples/spring-boot-sample-actuator/pom.xml
+19
-1
ShutdownSampleActuatorApplicationTests.java
...mple/actuator/ShutdownSampleActuatorApplicationTests.java
+14
-0
No files found.
spring-boot-samples/spring-boot-sample-actuator/pom.xml
View file @
12cb478b
...
...
@@ -24,7 +24,25 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jdbc
</artifactId>
</dependency>
<!-- Runtime -->
<dependency>
<groupId>
org.apache.httpcomponents
</groupId>
<artifactId>
httpclient
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
runtime
</scope>
</dependency>
<!-- Optional -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ShutdownSampleActuatorApplicationTests.java
View file @
12cb478b
...
...
@@ -25,8 +25,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.boot.test.context.SpringBootTest.WebEnvironment
;
import
org.springframework.boot.test.web.client.TestRestTemplate
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.junit4.SpringRunner
;
...
...
@@ -39,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
{
ShutdownSampleActuatorApplicationTests
.
SecurityConfiguration
.
class
,
SampleActuatorApplication
.
class
},
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
public
class
ShutdownSampleActuatorApplicationTests
{
...
...
@@ -73,4 +77,14 @@ public class ShutdownSampleActuatorApplicationTests {
return
"password"
;
}
@Configuration
static
class
SecurityConfiguration
extends
WebSecurityConfigurerAdapter
{
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
().
disable
();
}
}
}
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