use of com.google.cloud.tools.jib.registry.credentials.CredentialRetrievalException in project jib by GoogleContainerTools.
the class RegistryCredentialRetrieverTest method testCall_exception.
@Test
public void testCall_exception() throws CacheDirectoryCreationException {
CredentialRetrievalException credentialRetrievalException = Mockito.mock(CredentialRetrievalException.class);
BuildContext buildContext = makeFakeBuildContext(Collections.singletonList(() -> {
throw credentialRetrievalException;
}), Collections.emptyList());
try {
RegistryCredentialRetriever.getBaseImageCredential(buildContext);
Assert.fail("Should have thrown exception");
} catch (CredentialRetrievalException ex) {
Assert.assertSame(credentialRetrievalException, ex);
}
}
use of com.google.cloud.tools.jib.registry.credentials.CredentialRetrievalException in project jib by google.
the class RegistryCredentialRetrieverTest method testCall_exception.
@Test
public void testCall_exception() throws CacheDirectoryCreationException {
CredentialRetrievalException credentialRetrievalException = Mockito.mock(CredentialRetrievalException.class);
BuildContext buildContext = makeFakeBuildContext(Collections.singletonList(() -> {
throw credentialRetrievalException;
}), Collections.emptyList());
try {
RegistryCredentialRetriever.getBaseImageCredential(buildContext);
Assert.fail("Should have thrown exception");
} catch (CredentialRetrievalException ex) {
Assert.assertSame(credentialRetrievalException, ex);
}
}
Aggregations