BAEL-6277 - A Guide To Spring Cloud Azure (#13704)

* BAEL-6255 - Run a Spring Boot application in AWS Lambda

* BAEL-6255 - Run a Spring Boot application in AWS Lambda

* fix on template.yaml

* fix on template.yaml

* removed log from test

* resolved issues reported on PR

* BAEL-6277 - A Guide To Spring Cloud Azure

First commit

* BAEL-6277 - A Guide To Spring Cloud Azure

Added to README.md the steps to create the secrets

* BAEL-6277 - A Guide To Spring Cloud Azure

Added the integration Azure Key Vault Properties

* BAEL-6277 - A Guide To Spring Cloud Azure

Added the integration Azure Key Vault Properties

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

Added one level package keyvault

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

removed target release version

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

fix compilation of NoSuchElementException

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

fix pom.xml

* Revert "BAEL-6277 - A Guide To Spring Cloud Azure Key Vault"

This reverts commit 1cca1d0d692646001a6d7de106f3a37fb22839ce.

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

fix pom.xml

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

downgrade version to fix jenkins pipeline error

* BAEL-6277 - A Guide To Spring Cloud Azure Key Vault

comment run on main class

---------

Co-authored-by: Cesare <cesare.valenti@hotmail.com>
This commit is contained in:
cesarevalenti90
2023-04-02 17:57:11 +02:00
committed by GitHub
parent 4027e83023
commit 51caf72619
11 changed files with 301 additions and 1 deletions
@@ -0,0 +1,26 @@
package com.baeldung.spring.cloud.azure.keyvault;
import java.util.NoSuchElementException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import com.baeldung.spring.cloud.azure.keyvault.service.KeyVaultAutoconfiguredClient;
@SpringBootTest(classes = Application.class)
public class KeyVaultAutoconfiguredClientUnitTest {
@Autowired
@Qualifier(value = "KeyVaultAutoconfiguredClient")
private KeyVaultAutoconfiguredClient keyVaultAutoconfiguredClient;
@Test
void whenANotExistingKeyIsProvided_thenShouldReturnAnError() {
String secretKey = "mySecret";
Assertions.assertThrows(NoSuchElementException.class, () -> keyVaultAutoconfiguredClient.getSecret(secretKey));
}
}
@@ -0,0 +1,21 @@
spring:
cloud:
azure:
compatibility-verifier:
enabled: false
keyvault:
secret:
endpoint: https://spring-cloud-azure.vault.azure.net/
property-source-enabled: true
property-sources:
name: key-vault-property-source-1
endpoint: https://spring-cloud-azure.vault.azure.net/
azure:
keyvault:
vaultUrl: myVaultUrl
tenantId: myTenantId
clientId: myClientId
clientSecret: myClientSecret
database:
secret:
value: my-database-secret