Fix some deprecations

See gh-20388
pull/20523/head
dreis2211 5 years ago committed by Stephane Nicoll
parent 743671fabe
commit f08a9db984

@ -69,7 +69,7 @@ class MetricsWebFilterTests {
MockServerWebExchange exchange = createExchange("/projects/spring-boot", "/projects/{project}");
this.webFilter.filter(exchange, (serverWebExchange) -> Mono.error(new IllegalStateException("test error")))
.onErrorResume((t) -> {
exchange.getResponse().setStatusCodeValue(500);
exchange.getResponse().setRawStatusCode(500);
return exchange.getResponse().setComplete();
}).block(Duration.ofSeconds(30));
assertMetricsContainsTag("uri", "/projects/{project}");
@ -84,7 +84,7 @@ class MetricsWebFilterTests {
MockServerWebExchange exchange = createExchange("/projects/spring-boot", "/projects/{project}");
this.webFilter.filter(exchange, (serverWebExchange) -> Mono.error(anonymous)).onErrorResume((t) -> {
exchange.getResponse().setStatusCodeValue(500);
exchange.getResponse().setRawStatusCode(500);
return exchange.getResponse().setComplete();
}).block(Duration.ofSeconds(30));
assertMetricsContainsTag("uri", "/projects/{project}");
@ -96,7 +96,7 @@ class MetricsWebFilterTests {
void filterAddsTagsToRegistryForExceptionsAndCommittedResponse() {
MockServerWebExchange exchange = createExchange("/projects/spring-boot", "/projects/{project}");
this.webFilter.filter(exchange, (serverWebExchange) -> {
exchange.getResponse().setStatusCodeValue(500);
exchange.getResponse().setRawStatusCode(500);
return exchange.getResponse().setComplete().then(Mono.error(new IllegalStateException("test error")));
}).onErrorResume((t) -> Mono.empty()).block(Duration.ofSeconds(30));
assertMetricsContainsTag("uri", "/projects/{project}");

@ -75,7 +75,7 @@ class WebFluxTagsTests {
@Test
void uriTagToleratesCustomResponseStatus() {
this.exchange.getResponse().setStatusCodeValue(601);
this.exchange.getResponse().setRawStatusCode(601);
Tag tag = WebFluxTags.uri(this.exchange);
assertThat(tag.getValue()).isEqualTo("root");
}
@ -169,14 +169,14 @@ class WebFluxTagsTests {
@Test
void outcomeTagIsClientErrorWhenResponseIsNonStandardInClientSeries() {
this.exchange.getResponse().setStatusCodeValue(490);
this.exchange.getResponse().setRawStatusCode(490);
Tag tag = WebFluxTags.outcome(this.exchange);
assertThat(tag.getValue()).isEqualTo("CLIENT_ERROR");
}
@Test
void outcomeTagIsUnknownWhenResponseStatusIsInUnknownSeries() {
this.exchange.getResponse().setStatusCodeValue(701);
this.exchange.getResponse().setRawStatusCode(701);
Tag tag = WebFluxTags.outcome(this.exchange);
assertThat(tag.getValue()).isEqualTo("UNKNOWN");
}

@ -149,7 +149,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
.clientConnector(connector).build();
Mono<String> result = client.post().uri("/test").contentType(MediaType.TEXT_PLAIN)
.body(BodyInserters.fromObject("Hello World")).exchange()
.body(BodyInserters.fromValue("Hello World")).exchange()
.flatMap((response) -> response.bodyToMono(String.class));
StepVerifier.setDefaultTimeout(Duration.ofSeconds(30));

Loading…
Cancel
Save