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