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
f08a9db9
Commit
f08a9db9
authored
Mar 04, 2020
by
dreis2211
Committed by
Stephane Nicoll
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some deprecations
See gh-20388
parent
743671fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
MetricsWebFilterTests.java
...te/metrics/web/reactive/server/MetricsWebFilterTests.java
+3
-3
WebFluxTagsTests.java
...actuate/metrics/web/reactive/server/WebFluxTagsTests.java
+3
-3
AbstractReactiveWebServerFactoryTests.java
...eactive/server/AbstractReactiveWebServerFactoryTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilterTests.java
View file @
f08a9db9
...
@@ -69,7 +69,7 @@ class MetricsWebFilterTests {
...
@@ -69,7 +69,7 @@ class MetricsWebFilterTests {
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
Mono
.
error
(
new
IllegalStateException
(
"test error"
)))
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
Mono
.
error
(
new
IllegalStateException
(
"test error"
)))
.
onErrorResume
((
t
)
->
{
.
onErrorResume
((
t
)
->
{
exchange
.
getResponse
().
set
StatusCodeValu
e
(
500
);
exchange
.
getResponse
().
set
RawStatusCod
e
(
500
);
return
exchange
.
getResponse
().
setComplete
();
return
exchange
.
getResponse
().
setComplete
();
}).
block
(
Duration
.
ofSeconds
(
30
));
}).
block
(
Duration
.
ofSeconds
(
30
));
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
...
@@ -84,7 +84,7 @@ class MetricsWebFilterTests {
...
@@ -84,7 +84,7 @@ class MetricsWebFilterTests {
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
Mono
.
error
(
anonymous
)).
onErrorResume
((
t
)
->
{
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
Mono
.
error
(
anonymous
)).
onErrorResume
((
t
)
->
{
exchange
.
getResponse
().
set
StatusCodeValu
e
(
500
);
exchange
.
getResponse
().
set
RawStatusCod
e
(
500
);
return
exchange
.
getResponse
().
setComplete
();
return
exchange
.
getResponse
().
setComplete
();
}).
block
(
Duration
.
ofSeconds
(
30
));
}).
block
(
Duration
.
ofSeconds
(
30
));
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
...
@@ -96,7 +96,7 @@ class MetricsWebFilterTests {
...
@@ -96,7 +96,7 @@ class MetricsWebFilterTests {
void
filterAddsTagsToRegistryForExceptionsAndCommittedResponse
()
{
void
filterAddsTagsToRegistryForExceptionsAndCommittedResponse
()
{
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
MockServerWebExchange
exchange
=
createExchange
(
"/projects/spring-boot"
,
"/projects/{project}"
);
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
{
this
.
webFilter
.
filter
(
exchange
,
(
serverWebExchange
)
->
{
exchange
.
getResponse
().
set
StatusCodeValu
e
(
500
);
exchange
.
getResponse
().
set
RawStatusCod
e
(
500
);
return
exchange
.
getResponse
().
setComplete
().
then
(
Mono
.
error
(
new
IllegalStateException
(
"test error"
)));
return
exchange
.
getResponse
().
setComplete
().
then
(
Mono
.
error
(
new
IllegalStateException
(
"test error"
)));
}).
onErrorResume
((
t
)
->
Mono
.
empty
()).
block
(
Duration
.
ofSeconds
(
30
));
}).
onErrorResume
((
t
)
->
Mono
.
empty
()).
block
(
Duration
.
ofSeconds
(
30
));
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
assertMetricsContainsTag
(
"uri"
,
"/projects/{project}"
);
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/WebFluxTagsTests.java
View file @
f08a9db9
...
@@ -75,7 +75,7 @@ class WebFluxTagsTests {
...
@@ -75,7 +75,7 @@ class WebFluxTagsTests {
@Test
@Test
void
uriTagToleratesCustomResponseStatus
()
{
void
uriTagToleratesCustomResponseStatus
()
{
this
.
exchange
.
getResponse
().
set
StatusCodeValu
e
(
601
);
this
.
exchange
.
getResponse
().
set
RawStatusCod
e
(
601
);
Tag
tag
=
WebFluxTags
.
uri
(
this
.
exchange
);
Tag
tag
=
WebFluxTags
.
uri
(
this
.
exchange
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"root"
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"root"
);
}
}
...
@@ -169,14 +169,14 @@ class WebFluxTagsTests {
...
@@ -169,14 +169,14 @@ class WebFluxTagsTests {
@Test
@Test
void
outcomeTagIsClientErrorWhenResponseIsNonStandardInClientSeries
()
{
void
outcomeTagIsClientErrorWhenResponseIsNonStandardInClientSeries
()
{
this
.
exchange
.
getResponse
().
set
StatusCodeValu
e
(
490
);
this
.
exchange
.
getResponse
().
set
RawStatusCod
e
(
490
);
Tag
tag
=
WebFluxTags
.
outcome
(
this
.
exchange
);
Tag
tag
=
WebFluxTags
.
outcome
(
this
.
exchange
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"CLIENT_ERROR"
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"CLIENT_ERROR"
);
}
}
@Test
@Test
void
outcomeTagIsUnknownWhenResponseStatusIsInUnknownSeries
()
{
void
outcomeTagIsUnknownWhenResponseStatusIsInUnknownSeries
()
{
this
.
exchange
.
getResponse
().
set
StatusCodeValu
e
(
701
);
this
.
exchange
.
getResponse
().
set
RawStatusCod
e
(
701
);
Tag
tag
=
WebFluxTags
.
outcome
(
this
.
exchange
);
Tag
tag
=
WebFluxTags
.
outcome
(
this
.
exchange
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"UNKNOWN"
);
assertThat
(
tag
.
getValue
()).
isEqualTo
(
"UNKNOWN"
);
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java
View file @
f08a9db9
...
@@ -149,7 +149,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
...
@@ -149,7 +149,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.
clientConnector
(
connector
).
build
();
.
clientConnector
(
connector
).
build
();
Mono
<
String
>
result
=
client
.
post
().
uri
(
"/test"
).
contentType
(
MediaType
.
TEXT_PLAIN
)
Mono
<
String
>
result
=
client
.
post
().
uri
(
"/test"
).
contentType
(
MediaType
.
TEXT_PLAIN
)
.
body
(
BodyInserters
.
from
Object
(
"Hello World"
)).
exchange
()
.
body
(
BodyInserters
.
from
Value
(
"Hello World"
)).
exchange
()
.
flatMap
((
response
)
->
response
.
bodyToMono
(
String
.
class
));
.
flatMap
((
response
)
->
response
.
bodyToMono
(
String
.
class
));
StepVerifier
.
setDefaultTimeout
(
Duration
.
ofSeconds
(
30
));
StepVerifier
.
setDefaultTimeout
(
Duration
.
ofSeconds
(
30
));
...
...
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