Use HttpStatusCode interface

This commit contains changes made because of the introduction of
HttpStatusCode. In general, methods that used to return a HttpStatus
now return HttpStatusCode instead, and methods that returned raw status
codes are now deprecated.

See gh-28214
This commit is contained in:
Arjen Poutsma
2022-03-17 14:21:04 +01:00
parent ca4b6e86a4
commit 28ac0d3883
143 changed files with 1064 additions and 950 deletions

View File

@@ -22,6 +22,7 @@ import java.net.URI;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType;
import org.springframework.mock.http.client.MockClientHttpResponse;
import org.springframework.test.web.client.ResponseCreator;
@@ -133,7 +134,7 @@ class ResponseCreatorsTests {
DefaultResponseCreator responseCreator = MockRestResponseCreators.withRawStatus(454);
MockClientHttpResponse response = (MockClientHttpResponse) responseCreator.createResponse(null);
assertThat(response.getRawStatusCode()).isEqualTo(454);
assertThat(response.getStatusCode()).isEqualTo(HttpStatusCode.valueOf(454));
assertThat(response.getStatusText()).isEmpty();
}