Merge branch '5.1.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -161,6 +161,15 @@ public class ExchangeResult {
|
||||
return this.response.getStatusCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTTP status code (potentially non-standard and not resolvable
|
||||
* through the {@link HttpStatus} enum) as an integer.
|
||||
* @since 5.1.10
|
||||
*/
|
||||
public int getRawStatusCode() {
|
||||
return this.response.getRawStatusCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the response headers received from the server.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,7 +55,7 @@ public class StatusAssertions {
|
||||
* Assert the response status as an integer.
|
||||
*/
|
||||
public WebTestClient.ResponseSpec isEqualTo(int status) {
|
||||
int actual = this.exchangeResult.getStatus().value();
|
||||
int actual = this.exchangeResult.getRawStatusCode();
|
||||
this.exchangeResult.assertWithDiagnostics(() -> AssertionErrors.assertEquals("Status", status, actual));
|
||||
return this.responseSpec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user