Support for non-standard HTTP status in reactive ClientHttpResponse

Issue: SPR-16748
This commit is contained in:
Juergen Hoeller
2018-04-27 18:25:11 +02:00
parent 44cf002c00
commit a683472daa
12 changed files with 92 additions and 75 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -40,6 +40,7 @@ import org.springframework.util.MultiValueMap;
/**
* Mock implementation of {@link ClientHttpResponse}.
*
* @author Brian Clozel
* @author Rossen Stoyanchev
* @since 5.0
@@ -68,6 +69,11 @@ public class MockClientHttpResponse implements ClientHttpResponse {
return this.status;
}
@Override
public int getRawStatusCode() {
return this.status.value();
}
@Override
public HttpHeaders getHeaders() {
String headerName = HttpHeaders.SET_COOKIE;
@@ -138,4 +144,4 @@ public class MockClientHttpResponse implements ClientHttpResponse {
return (charset != null ? charset : StandardCharsets.UTF_8);
}
}
}