Search in sources :

Example 21 with CreateContainerParams

use of org.eclipse.che.plugin.docker.client.params.CreateContainerParams in project che by eclipse.

the class DockerConnectorTest method shouldThrowDockerExceptionWhileCreatingContainerIfResponseCodeIsNotSuccess.

@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = EXCEPTION_ERROR_MESSAGE)
public void shouldThrowDockerExceptionWhileCreatingContainerIfResponseCodeIsNotSuccess() throws IOException {
    CreateContainerParams createContainerParams = CreateContainerParams.create(new ContainerConfig());
    when(dockerResponse.getStatus()).thenReturn(RESPONSE_ERROR_CODE);
    dockerConnector.createContainer(createContainerParams);
    verify(dockerResponse).getStatus();
}
Also used : ContainerConfig(org.eclipse.che.plugin.docker.client.json.ContainerConfig) CreateContainerParams(org.eclipse.che.plugin.docker.client.params.CreateContainerParams) Test(org.testng.annotations.Test)

Aggregations

CreateContainerParams (org.eclipse.che.plugin.docker.client.params.CreateContainerParams)21 Test (org.testng.annotations.Test)21 CheServiceImpl (org.eclipse.che.api.environment.server.model.CheServiceImpl)15 Matchers.anyString (org.mockito.Matchers.anyString)15 ContainerConfig (org.eclipse.che.plugin.docker.client.json.ContainerConfig)14 ArrayList (java.util.ArrayList)12 ContainerCreated (org.eclipse.che.plugin.docker.client.json.ContainerCreated)11 IOException (java.io.IOException)10 Arrays (java.util.Arrays)10 Arrays.asList (java.util.Arrays.asList)10 Collections (java.util.Collections)10 Collections.emptySet (java.util.Collections.emptySet)10 Collections.singleton (java.util.Collections.singleton)10 Collections.singletonMap (java.util.Collections.singletonMap)10 HashMap (java.util.HashMap)10 HashSet (java.util.HashSet)10 List (java.util.List)10 Map (java.util.Map)10 Set (java.util.Set)10 Function (java.util.function.Function)10