Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public WebTestClient.ResponseSpec is5xxServerError() {
* @since 5.1
*/
public WebTestClient.ResponseSpec value(Matcher<? super Integer> matcher) {
int value = this.exchangeResult.getStatus().value();
int value = this.exchangeResult.getRawStatusCode();
this.exchangeResult.assertWithDiagnostics(() -> MatcherAssert.assertThat("Response status", value, matcher));
return this.responseSpec;
}
Expand All @@ -216,7 +216,7 @@ public WebTestClient.ResponseSpec value(Matcher<? super Integer> matcher) {
* @since 5.1
*/
public WebTestClient.ResponseSpec value(Consumer<Integer> consumer) {
int value = this.exchangeResult.getStatus().value();
int value = this.exchangeResult.getRawStatusCode();
this.exchangeResult.assertWithDiagnostics(() -> consumer.accept(value));
return this.responseSpec;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ void matches() {
assertions.value(equalTo(200)));
}

@Test
void matchesWithCustomStatus() {
statusAssertions(600).value(equalTo(600));
}

private StatusAssertions statusAssertions(HttpStatus status) {
return statusAssertions(status.value());
Expand Down