void writeResponseActionResponse(final HttpResponse response, final ResponseWriter responseWriter, final HttpRequest request, final Action action, boolean synchronous) { scheduler.schedule(new Runnable() { public void run() { mockServerLogger.info(EXPECTATION_RESPONSE, request, "returning response:{}for request:{}for action:{}", response, request, action); responseWriter.writeResponse(request, response, false); } }, synchronous, action.getDelay(), response.getDelay()); }
public HttpResponseDTO(HttpResponse httpResponse) { if (httpResponse != null) { statusCode = httpResponse.getStatusCode(); reasonPhrase = httpResponse.getReasonPhrase(); body = BodyWithContentTypeDTO.createDTO(httpResponse.getBody()); headers = httpResponse.getHeaders(); cookies = httpResponse.getCookies(); delay = (httpResponse.getDelay() != null ? new DelayDTO(httpResponse.getDelay()) : null); connectionOptions = (httpResponse.getConnectionOptions() != null ? new ConnectionOptionsDTO(httpResponse.getConnectionOptions()) : null); } }
public HttpResponse clone() { return response() .withStatusCode(statusCode) .withReasonPhrase(reasonPhrase) .withBody(body) .withHeaders(headers.clone()) .withCookies(cookies.clone()) .withDelay(getDelay()) .withConnectionOptions(connectionOptions); } }
void writeResponseActionResponse(final HttpResponse response, final ResponseWriter responseWriter, final HttpRequest request, final Action action, boolean synchronous) { scheduler.schedule(new Runnable() { public void run() { responseWriter.writeResponse(request, response, false); mockServerLogger.info(EXPECTATION_RESPONSE, request, "returning response:{}for request:{}for action:{}", response, request, action); } }, synchronous, action.getDelay(), response.getDelay()); }
public HttpResponseDTO(HttpResponse httpResponse) { if (httpResponse != null) { statusCode = httpResponse.getStatusCode(); reasonPhrase = httpResponse.getReasonPhrase(); body = BodyWithContentTypeDTO.createDTO(httpResponse.getBody()); headers = httpResponse.getHeaders(); cookies = httpResponse.getCookies(); delay = (httpResponse.getDelay() != null ? new DelayDTO(httpResponse.getDelay()) : null); connectionOptions = (httpResponse.getConnectionOptions() != null ? new ConnectionOptionsDTO(httpResponse.getConnectionOptions()) : null); } }
public HttpResponse clone() { return response() .withStatusCode(statusCode) .withReasonPhrase(reasonPhrase) .withBody(body) .withHeaders(headers.clone()) .withCookies(cookies.clone()) .withDelay(getDelay()) .withConnectionOptions(connectionOptions); } }