Skip to content

Commit 48e2e9d

Browse files
committed
Adapt to changes in Spring Framework 6.0 HttpStatus.
Fixes #2134.
1 parent a60f305 commit 48e2e9d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/org/springframework/data/elasticsearch/client/ClientLogger.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.commons.logging.Log;
2121
import org.apache.commons.logging.LogFactory;
2222
import org.springframework.http.HttpStatus;
23+
import org.springframework.http.HttpStatusCode;
2324
import org.springframework.lang.Nullable;
2425
import org.springframework.util.ObjectUtils;
2526

@@ -30,6 +31,7 @@
3031
* @author Mark Paluch
3132
* @author Christoph Strobl
3233
* @author Peter-Josef Meisch
34+
* @author Oliver Drotbohm
3335
* @since 3.2
3436
*/
3537
public abstract class ClientLogger {
@@ -125,7 +127,7 @@ public static void logRequest(String logId, String method, String endpoint, Obje
125127
* @param logId the correlation id, see {@link #newLogId()}.
126128
* @param statusCode the HTTP status code.
127129
*/
128-
public static void logRawResponse(String logId, @Nullable HttpStatus statusCode) {
130+
public static void logRawResponse(String logId, @Nullable HttpStatusCode statusCode) {
129131

130132
if (isEnabled()) {
131133
WIRE_LOGGER.trace(String.format("[%s] Received raw response: %s", logId, statusCode));
@@ -153,7 +155,7 @@ public static void logRawResponse(String logId, @Nullable HttpStatus statusCode,
153155
* @param statusCode the HTTP status code.
154156
* @param body body content.
155157
*/
156-
public static void logResponse(String logId, HttpStatus statusCode, String body) {
158+
public static void logResponse(String logId, HttpStatusCode statusCode, String body) {
157159

158160
if (isEnabled()) {
159161
WIRE_LOGGER.trace(String.format("[%s] Received response: %s%nResponse body: %s", logId, statusCode, body));

src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import org.elasticsearch.action.ActionResponse;
2323
import org.elasticsearch.common.io.stream.StreamOutput;
24-
import org.springframework.http.HttpStatus;
24+
import org.springframework.http.HttpStatusCode;
2525
import org.springframework.http.client.reactive.ClientHttpResponse;
2626
import org.springframework.web.reactive.function.BodyExtractor;
2727
import org.springframework.web.reactive.function.client.ClientResponse;
@@ -32,6 +32,7 @@
3232
* @author Christoph Strobl
3333
* @author Peter-Josef Meisch
3434
* @author Mark Paluch
35+
* @author Oliver Drotbohm
3536
* @since 3.2
3637
*/
3738
class RawActionResponse extends ActionResponse {
@@ -46,7 +47,7 @@ static RawActionResponse create(ClientResponse response) {
4647
return new RawActionResponse(response);
4748
}
4849

49-
public HttpStatus statusCode() {
50+
public HttpStatusCode statusCode() {
5051
return delegate.statusCode();
5152
}
5253

0 commit comments

Comments
 (0)