In case someone also want to dump response like me. i avoided to dump response body. following code just dump the StatusCode and Headers.
static private String dumpResponse(HttpServletResponse resp){
StringBuilder sb = new StringBuilder();
sb.append("Response Status = [" + resp.getStatus() + "], ");
String headers = resp.getHeaderNames().stream()
.map(headerName -> headerName + " : " + resp.getHeaders(headerName) )
.collect(Collectors.joining(", "));
if (headers.isEmpty()) {
sb.append("Response headers: NONE,");
} else {
sb.append("Response headers: "+headers+",");
}
return sb.toString();
}