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