use of org.eclipse.che.plugin.docker.client.params.GetEventsParams in project che by eclipse.
the class DockerConnectorTest method shouldBeAbleToGetEvents.
@Test
public void shouldBeAbleToGetEvents() throws IOException {
GetEventsParams getEventsParams = GetEventsParams.create();
doReturn(new ByteArrayInputStream(STREAM_DATA_BYTES)).when(dockerResponse).getInputStream();
dockerConnector.getEvents(getEventsParams, eventMessageProcessor);
verify(dockerConnectionFactory).openConnection(any(URI.class));
verify(dockerConnection).method(REQUEST_METHOD_GET);
verify(dockerConnection).path("/events");
verify(dockerConnection).request();
verify(dockerResponse).getStatus();
verify(dockerResponse).getInputStream();
}
use of org.eclipse.che.plugin.docker.client.params.GetEventsParams in project che by eclipse.
the class DockerConnectorTest method shouldThrowDockerExceptionWhileGettingEventsIfResponseCodeIsNotSuccess.
@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = EXCEPTION_ERROR_MESSAGE)
public void shouldThrowDockerExceptionWhileGettingEventsIfResponseCodeIsNotSuccess() throws IOException {
GetEventsParams getExecInfoParams = GetEventsParams.create();
when(dockerResponse.getStatus()).thenReturn(RESPONSE_ERROR_CODE);
dockerConnector.getEvents(getExecInfoParams, eventMessageProcessor);
verify(dockerResponse).getStatus();
}
Aggregations