use of org.graylog.shaded.elasticsearch7.org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testUnauthorizedResponseCodeAnalysis.
@Test
public void testUnauthorizedResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_UNAUTHORIZED, "Unauthorized");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_UNAUTHORIZED, response);
verify(response).getStatusLine();
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testNotAllowedResponseCodeAnalysis.
@Test
public void testNotAllowedResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_METHOD_NOT_ALLOWED, "Method Not Allowed");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_METHOD_NOT_ALLOWED, response);
verify(response, new VerificationMode() {
@Override
public void verify(VerificationData verificationData) {
Assert.assertEquals(2, verificationData.getAllInvocations().size());
}
}).getStatusLine();
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testNotImplementedResponseCodeAnalysis.
@Test
public void testNotImplementedResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_NOT_IMPLEMENTED, "Not Implemented");
when(response.getStatusLine()).thenReturn(statusLine);
try {
RestClient.responseCodeAnalysis(response);
Assert.fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
}
verify(response).getStatusLine();
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testOkResponseCodeAnalysis.
@Test
public void testOkResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_OK, "OK");
when(response.getStatusLine()).thenReturn(statusLine);
RestClient.responseCodeAnalysis(response);
verify(response).getStatusLine();
}
use of org.graylog.shaded.elasticsearch7.org.apache.http.message.BasicStatusLine in project cdap-ingest by caskdata.
the class RestClientTest method testNotFoundResponseCodeAnalysis.
@Test
public void testNotFoundResponseCodeAnalysis() {
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), HttpStatus.SC_NOT_FOUND, "Not Found");
when(response.getStatusLine()).thenReturn(statusLine);
TestUtils.verifyResponse(HttpStatus.SC_NOT_FOUND, response);
verify(response).getStatusLine();
}
Aggregations