use of org.eclipse.che.plugin.docker.client.params.StopContainerParams in project che by eclipse.
the class DockerConnectorTest method shouldBeAbleToStopContainer.
@Test
public void shouldBeAbleToStopContainer() throws IOException {
StopContainerParams stopContainerParams = StopContainerParams.create(CONTAINER);
dockerConnector.stopContainer(stopContainerParams);
verify(dockerConnectionFactory).openConnection(any(URI.class));
verify(dockerConnection).method(REQUEST_METHOD_POST);
verify(dockerConnection).path("/containers/" + stopContainerParams.getContainer() + "/stop");
verify(dockerConnection).request();
verify(dockerResponse).getStatus();
}
use of org.eclipse.che.plugin.docker.client.params.StopContainerParams in project che by eclipse.
the class DockerConnectorTest method shouldThrowDockerExceptionWhileStoppingContainerIfResponseCodeIsNotSuccess.
@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = EXCEPTION_ERROR_MESSAGE)
public void shouldThrowDockerExceptionWhileStoppingContainerIfResponseCodeIsNotSuccess() throws IOException {
StopContainerParams stopContainerParams = StopContainerParams.create(CONTAINER);
when(dockerResponse.getStatus()).thenReturn(RESPONSE_ERROR_CODE);
dockerConnector.stopContainer(stopContainerParams);
verify(dockerResponse).getStatus();
}
Aggregations