BAEL 1756 (#4263) - Review comments incorporated

This commit is contained in:
Tino Mulanchira Thomas 2018-05-18 10:34:22 +03:00 committed by Predrag Maric
parent 1e3b3f27a4
commit 488b449253
1 changed files with 4 additions and 6 deletions

View File

@ -22,20 +22,18 @@ public class RestTemplateLoggingInterceptor implements ClientHttpRequestIntercep
}
private void logRequest(byte[] body) {
String payLoad = StringUtils.EMPTY;
if (body.length > 0) {
payLoad = new String(body, StandardCharsets.UTF_8);
String payLoad = new String(body, StandardCharsets.UTF_8);
System.out.println(payLoad);
}
System.out.println("Request Body > " + payLoad);
}
private void logResponse(ClientHttpResponse response) throws IOException {
String payLoad = StringUtils.EMPTY;
long contentLength = response.getHeaders()
.getContentLength();
if (contentLength != 0) {
payLoad = StreamUtils.copyToString(response.getBody(), StandardCharsets.UTF_8);
String payLoad = StreamUtils.copyToString(response.getBody(), StandardCharsets.UTF_8);
System.out.println(payLoad);
}
System.out.println("Response Body > " + payLoad);
}
}