Improve handling of non-standard status codes in WebFluxTags

Closes gh-18267
This commit is contained in:
Andy Wilkinson
2019-09-18 09:52:39 +01:00
parent 6534047fcf
commit b15e427a3e
2 changed files with 27 additions and 2 deletions

View File

@@ -152,4 +152,18 @@ class WebFluxTagsTests {
assertThat(tag.getValue()).isEqualTo("SERVER_ERROR");
}
@Test
void outcomeTagIsClientErrorWhenResponseIsNonStandardInClientSeries() {
this.exchange.getResponse().setStatusCodeValue(490);
Tag tag = WebFluxTags.outcome(this.exchange);
assertThat(tag.getValue()).isEqualTo("CLIENT_ERROR");
}
@Test
void outcomeTagIsUnknownWhenResponseStatusIsInUnknownSeries() {
this.exchange.getResponse().setStatusCodeValue(701);
Tag tag = WebFluxTags.outcome(this.exchange);
assertThat(tag.getValue()).isEqualTo("UNKNOWN");
}
}