@Test(expectedExceptions = AuthorizationException.class) public void testAuthorizationExceptionIsThrownOnBadKeys() { PrivateKeySupplier supplier = new PrivateKeySupplier( Suppliers.ofInstance(new Credentials("MOMMA", "FileNotFoundCredential")), new PrivateKeyForCredentials()); supplier.get(); }
@Override public PrivateKey get() { try { return keyCache.getUnchecked(checkNotNull(creds.get(), "credential supplier returned null")); } catch (UncheckedExecutionException e) { AuthorizationException authorizationException = getFirstThrowableOfType(e, AuthorizationException.class); if (authorizationException != null) { throw authorizationException; } throw e; } }
PrivateKeySupplier implements Supplier<PrivateKey> { @Override public PrivateKey get() { try { return keyCache.getUnchecked(checkNotNull(creds.get(), "credential supplier returned null")); } catch (UncheckedExecutionException e) { AuthorizationException authorizationException = getFirstThrowableOfType(e, AuthorizationException.class); if (authorizationException != null) { throw authorizationException; } throw e; } } }
PrivateKeySupplier implements Supplier<PrivateKey> { @Override public PrivateKey get() { try { return keyCache.getUnchecked(checkNotNull(creds.get(), "credential supplier returned null")); } catch (UncheckedExecutionException e) { AuthorizationException authorizationException = getFirstThrowableOfType(e, AuthorizationException.class); if (authorizationException != null) { throw authorizationException; } throw e; } } @Inject  PrivateKeySupplier(@Provider Supplier<Credentials> creds, PrivateKeyForCredentials loader); }
PrivateKeySupplier implements Supplier<PrivateKey> { @Override public PrivateKey get() { try { return keyCache.getUnchecked(checkNotNull(creds.get(), "credential supplier returned null")); } catch (UncheckedExecutionException e) { AuthorizationException authorizationException = getFirstThrowableOfType(e, AuthorizationException.class); if (authorizationException != null) { throw authorizationException; } throw e; } } @Inject  PrivateKeySupplier(@Provider Supplier<Credentials> creds, PrivateKeyForCredentials loader); @Override PrivateKey get(); }
PrivateKeySupplier implements Supplier<PrivateKey> { @Override public PrivateKey get() { try { return keyCache.getUnchecked(checkNotNull(creds.get(), "credential supplier returned null")); } catch (UncheckedExecutionException e) { AuthorizationException authorizationException = getFirstThrowableOfType(e, AuthorizationException.class); if (authorizationException != null) { throw authorizationException; } throw e; } } @Inject  PrivateKeySupplier(@Provider Supplier<Credentials> creds, PrivateKeyForCredentials loader); @Override PrivateKey get();  }