BAEL-6277 - A Guide To Spring Cloud Azure Key Vault
fix compilation of NoSuchElementException
This commit is contained in:
@@ -14,7 +14,7 @@ public interface KeyVaultClient {
|
||||
try {
|
||||
secret = getSecretClient().getSecret(key);
|
||||
} catch (Exception ex) {
|
||||
throw new NoSuchElementException(String.format("Unable to retrieve %s secret", key), ex);
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
return secret;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@ public class KeyVaultAutoconfiguredClientUnitTest {
|
||||
@Test
|
||||
void whenANotExistingKeyIsProvided_thenShouldReturnAnError() {
|
||||
String secretKey = "mySecret";
|
||||
Assertions.assertThrows(NoSuchElementException.class, () -> {
|
||||
keyVaultAutoconfiguredClient.getSecret(secretKey);
|
||||
});
|
||||
Assertions.assertThrows(NoSuchElementException.class, () -> keyVaultAutoconfiguredClient.getSecret(secretKey));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user