use of org.eclipse.che.plugin.docker.client.params.PushParams in project che by eclipse.
the class DockerConnectorTest method shouldThrowDockerExceptionWhenPushImageButOutputIsEmpty.
@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = "Docker image pushing failed. Cause: .*")
public void shouldThrowDockerExceptionWhenPushImageButOutputIsEmpty() throws IOException, InterruptedException {
PushParams pushParams = PushParams.create(REPOSITORY);
dockerConnector.push(pushParams, progressMonitor);
}
use of org.eclipse.che.plugin.docker.client.params.PushParams in project che by eclipse.
the class DockerConnectorTest method shouldThrowDockerExceptionWhenPushImageButDigestOutputMissing.
@Test(expectedExceptions = DockerException.class, expectedExceptionsMessageRegExp = "Docker image pushing failed. Cause: Docker push response doesn't contain image digest")
public void shouldThrowDockerExceptionWhenPushImageButDigestOutputMissing() throws IOException, InterruptedException {
String dockerPushOutput = "{\"progress\":\"[=====> ] 25%\"}\n" + "{\"status\":\"Image already exists\"}\n" + "{\"progress\":\"[===============> ] 75%\"}\n";
when(dockerResponse.getInputStream()).thenReturn(new ByteArrayInputStream(dockerPushOutput.getBytes()));
PushParams pushParams = PushParams.create(REPOSITORY);
dockerConnector.push(pushParams, progressMonitor);
}
Aggregations