public void setUnderlyingHttpRequest(final HttpRequest httpRequest) { final String body = httpRequest.getBody().map(s -> JsonUtils.prettyPrintJsonStringSecureWithFallback(s)).orElse("<no body>"); final String requestAsString = new StringBuilder(httpRequest.getHttpMethod().toString()).append(" ").append(httpRequest.getPath()).append("\n").append(body).toString(); setUnderlyingHttpRequest(requestAsString); }
public void setUnderlyingHttpResponse(final HttpResponse httpResponse) { final String s = "status=" + httpResponse.getStatusCode() + " " + JsonUtils.prettyPrintJsonStringSecureWithFallback(httpResponse.getResponseBody()); setUnderlyingHttpResponse(s); } }