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
b5d8e072
Commit
b5d8e072
authored
Sep 13, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add actuator to webflux sample
Closes gh-10258
parent
73f4a2e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
pom.xml
spring-boot-samples/spring-boot-sample-webflux/pom.xml
+12
-0
SampleWebFluxApplicationTests.java
...st/java/sample/webflux/SampleWebFluxApplicationTests.java
+9
-2
No files found.
spring-boot-samples/spring-boot-sample-webflux/pom.xml
View file @
b5d8e072
...
@@ -25,6 +25,10 @@
...
@@ -25,6 +25,10 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-webflux
</artifactId>
<artifactId>
spring-boot-starter-webflux
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<!-- Test -->
<!-- Test -->
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
...
@@ -42,6 +46,14 @@
...
@@ -42,6 +46,14 @@
<plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<id>
generate build info
</id>
<goals>
<goal>
build-info
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
...
...
spring-boot-samples/spring-boot-sample-webflux/src/test/java/sample/webflux/SampleWebFluxApplicationTests.java
View file @
b5d8e072
...
@@ -40,17 +40,24 @@ public class SampleWebFluxApplicationTests {
...
@@ -40,17 +40,24 @@ public class SampleWebFluxApplicationTests {
private
WebTestClient
webClient
;
private
WebTestClient
webClient
;
@Test
@Test
public
void
testWelcome
()
throws
Exception
{
public
void
testWelcome
()
{
this
.
webClient
.
get
().
uri
(
"/"
).
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
()
this
.
webClient
.
get
().
uri
(
"/"
).
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
()
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello World"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello World"
);
}
}
@Test
@Test
public
void
testEcho
()
throws
Exception
{
public
void
testEcho
()
{
this
.
webClient
.
post
().
uri
(
"/echo"
).
contentType
(
MediaType
.
TEXT_PLAIN
)
this
.
webClient
.
post
().
uri
(
"/echo"
).
contentType
(
MediaType
.
TEXT_PLAIN
)
.
accept
(
MediaType
.
TEXT_PLAIN
)
.
accept
(
MediaType
.
TEXT_PLAIN
)
.
body
(
Mono
.
just
(
"Hello WebFlux!"
),
String
.
class
).
exchange
()
.
body
(
Mono
.
just
(
"Hello WebFlux!"
),
String
.
class
).
exchange
()
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello WebFlux!"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"Hello WebFlux!"
);
}
}
@Test
public
void
testActuatorStatus
()
{
this
.
webClient
.
get
().
uri
(
"/application/status"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
exchange
().
expectStatus
().
isOk
().
expectBody
()
.
json
(
"{\"status\":\"UP\"}"
);
}
}
}
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