use of org.eclipse.che.plugin.docker.client.params.BuildImageParams in project che by eclipse.
the class DockerConnectorTest method shouldThrowDockerExceptionWhileBuildingImageIfResponseCodeIsNotSuccess.
@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = EXCEPTION_ERROR_MESSAGE)
public void shouldThrowDockerExceptionWhileBuildingImageIfResponseCodeIsNotSuccess() throws IOException, InterruptedException {
AuthConfigs authConfigs = DtoFactory.newDto(AuthConfigs.class);
AuthConfig authConfig = DtoFactory.newDto(AuthConfig.class);
Map<String, AuthConfig> auth = new HashMap<>();
auth.put("auth", authConfig);
authConfigs.setConfigs(auth);
BuildImageParams getExecInfoParams = BuildImageParams.create(dockerfile).withAuthConfigs(authConfigs);
when(dockerResponse.getStatus()).thenReturn(RESPONSE_ERROR_CODE);
dockerConnector.buildImage(getExecInfoParams, progressMonitor);
verify(dockerResponse).getStatus();
}
Aggregations