Polishing

This commit is contained in:
Juergen Hoeller
2019-09-25 12:14:48 +02:00
parent 0519a2ff3c
commit bb6f9bb6d4
12 changed files with 33 additions and 35 deletions

View File

@@ -155,7 +155,7 @@ public class ExchangeResult {
/**
* Return the status of the executed request.
* Return the HTTP status code as an {@link HttpStatus} enum value.
*/
public HttpStatus getStatus() {
return this.response.getStatusCode();
@@ -219,16 +219,12 @@ public class ExchangeResult {
"\n" +
formatBody(getRequestHeaders().getContentType(), this.requestBody) + "\n" +
"\n" +
"< " + getStatus() + " " + getStatusReason() + "\n" +
"< " + getStatus() + " " + getStatus().getReasonPhrase() + "\n" +
"< " + formatHeaders(getResponseHeaders(), "\n< ") + "\n" +
"\n" +
formatBody(getResponseHeaders().getContentType(), this.responseBody) +"\n";
}
private String getStatusReason() {
return getStatus().getReasonPhrase();
}
private String formatHeaders(HttpHeaders headers, String delimiter) {
return headers.entrySet().stream()
.map(entry -> entry.getKey() + ": " + entry.getValue())