Search in sources :

Example 6 with InsecureRegistryException

use of com.google.cloud.tools.jib.api.InsecureRegistryException in project jib by GoogleContainerTools.

the class JibBuildRunnerTest method testBuildImage_insecureRegistryException.

@Test
public void testBuildImage_insecureRegistryException() throws InterruptedException, IOException, CacheDirectoryCreationException, RegistryException, ExecutionException {
    InsecureRegistryException mockInsecureRegistryException = Mockito.mock(InsecureRegistryException.class);
    Mockito.doThrow(mockInsecureRegistryException).when(mockJibContainerBuilder).containerize(mockContainerizer);
    try {
        testJibBuildRunner.runBuild();
        Assert.fail();
    } catch (BuildStepsExecutionException ex) {
        Assert.assertEquals(TEST_HELPFUL_SUGGESTIONS.forInsecureRegistry(), ex.getMessage());
    }
}
Also used : InsecureRegistryException(com.google.cloud.tools.jib.api.InsecureRegistryException) Test(org.junit.Test)

Aggregations

InsecureRegistryException (com.google.cloud.tools.jib.api.InsecureRegistryException)6 RegistryUnauthorizedException (com.google.cloud.tools.jib.api.RegistryUnauthorizedException)4 ResponseException (com.google.cloud.tools.jib.http.ResponseException)4 JibContainer (com.google.cloud.tools.jib.api.JibContainer)2 RegistryAuthenticationFailedException (com.google.cloud.tools.jib.api.RegistryAuthenticationFailedException)2 RegistryException (com.google.cloud.tools.jib.api.RegistryException)2 Request (com.google.cloud.tools.jib.http.Request)2 Response (com.google.cloud.tools.jib.http.Response)2 RegistryCredentialsNotSentException (com.google.cloud.tools.jib.registry.RegistryCredentialsNotSentException)2 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 ExecutionException (java.util.concurrent.ExecutionException)2 SSLException (javax.net.ssl.SSLException)2 HttpHostConnectException (org.apache.http.conn.HttpHostConnectException)2 Test (org.junit.Test)2