Skip to content

Commit 57cb8c7

Browse files
committed
Restore rawStatusCode methods
Revert methods removed in 7df2e2a. See gh-33440
1 parent 871539a commit 57cb8c7

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

spring-test/src/main/java/org/springframework/test/web/reactive/server/ExchangeResult.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -176,6 +176,16 @@ public HttpStatusCode getStatus() {
176176
return this.response.getStatusCode();
177177
}
178178

179+
/**
180+
* Return the HTTP status code as an integer.
181+
* @since 5.1.10
182+
* @deprecated as of 6.0, in favor of {@link #getStatus()}
183+
*/
184+
@Deprecated(since = "6.0", forRemoval = true)
185+
public int getRawStatusCode() {
186+
return getStatus().value();
187+
}
188+
179189
/**
180190
* Return the response headers received from the server.
181191
*/

spring-web/src/main/java/org/springframework/http/client/reactive/ClientHttpResponse.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,6 +46,18 @@ default String getId() {
4646
*/
4747
HttpStatusCode getStatusCode();
4848

49+
/**
50+
* Return the HTTP status code as an integer.
51+
* @return the HTTP status as an integer value
52+
* @since 5.0.6
53+
* @see #getStatusCode()
54+
* @deprecated as of 6.0, in favor of {@link #getStatusCode()}
55+
*/
56+
@Deprecated(since = "6.0", forRemoval = true)
57+
default int getRawStatusCode() {
58+
return getStatusCode().value();
59+
}
60+
4961
/**
5062
* Return a read-only map of response cookies received from the server.
5163
*/

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ClientResponse.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,6 +57,17 @@ public interface ClientResponse {
5757
*/
5858
HttpStatusCode statusCode();
5959

60+
/**
61+
* Return the raw status code of this response.
62+
* @return the HTTP status as an integer value
63+
* @since 5.1
64+
* @deprecated as of 6.0, in favor of {@link #statusCode()}
65+
*/
66+
@Deprecated(since = "6.0", forRemoval = true)
67+
default int rawStatusCode() {
68+
return statusCode().value();
69+
}
70+
6071
/**
6172
* Return the headers of this response.
6273
*/

0 commit comments

Comments
 (0)