use of org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testConflictResponseCodeAnalysis.
@Test
public void testConflictResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_CONFLICT, "Conflict");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_CONFLICT, response);
verify(response).getStatusLine();
}
use of org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testInternalServerErrorResponseCodeAnalysis.
@Test
public void testInternalServerErrorResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal Server Error");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_INTERNAL_SERVER_ERROR, response);
verify(response).getStatusLine();
}
use of org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testBadRequestResponseCodeAnalysis.
@Test
public void testBadRequestResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_BAD_REQUEST, "Bad Request");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_BAD_REQUEST, response);
verify(response).getStatusLine();
}
use of org.apache.http.message.BasicStatusLine in project FastDev4Android by jiangqqlmj.
the class MockHttpClient method execute.
// This is the only one we actually use.
@Override
public HttpResponse execute(HttpUriRequest request, HttpContext context) {
requestExecuted = request;
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), mStatusCode, "");
HttpResponse response = new BasicHttpResponse(statusLine);
response.setEntity(mResponseEntity);
return response;
}
use of org.apache.http.message.BasicStatusLine in project elasticsearch by elastic.
the class FailureTrackingResponseListenerTests method mockResponse.
private static Response mockResponse() {
ProtocolVersion protocolVersion = new ProtocolVersion("HTTP", 1, 1);
RequestLine requestLine = new BasicRequestLine("GET", "/", protocolVersion);
StatusLine statusLine = new BasicStatusLine(protocolVersion, 200, "OK");
HttpResponse httpResponse = new BasicHttpResponse(statusLine);
return new Response(requestLine, new HttpHost("localhost", 9200), httpResponse);
}
Aggregations