use of com.quorum.tessera.config.DefaultKeyVaultConfig in project tessera by ConsenSys.
the class KeyVaultConfigValidatorTest method validHashicorpConfig.
@Test
public void validHashicorpConfig() throws Exception {
Path somePath = Files.createTempFile(UUID.randomUUID().toString(), ".txt");
somePath.toFile().deleteOnExit();
DefaultKeyVaultConfig config = new DefaultKeyVaultConfig();
config.setKeyVaultType(KeyVaultType.HASHICORP);
config.setProperty("url", "someurl");
config.setProperty("tlsKeyStorePath", somePath.toString());
config.setProperty("tlsTrustStorePath", somePath.toString());
assertThat(keyVaultConfigValidator.isValid(config, context)).isTrue();
}
use of com.quorum.tessera.config.DefaultKeyVaultConfig in project tessera by ConsenSys.
the class KeyVaultConfigValidatorTest method nullKeyVaultTypeIsAllowedAndWillBePickedUpByNotNullAnnotation.
@Test
public void nullKeyVaultTypeIsAllowedAndWillBePickedUpByNotNullAnnotation() {
DefaultKeyVaultConfig config = new DefaultKeyVaultConfig();
assertThat(keyVaultConfigValidator.isValid(config, context)).isTrue();
}
use of com.quorum.tessera.config.DefaultKeyVaultConfig in project tessera by ConsenSys.
the class KeyVaultConfigValidatorTest method invalidHashicorpConfig.
@Test
public void invalidHashicorpConfig() {
Path somePath = mock(Path.class);
DefaultKeyVaultConfig config = new DefaultKeyVaultConfig();
config.setKeyVaultType(KeyVaultType.HASHICORP);
config.setProperty("tlsKeyStorePath", somePath.toString());
config.setProperty("tlsTrustStorePath", somePath.toString());
assertThat(keyVaultConfigValidator.isValid(config, context)).isFalse();
}
use of com.quorum.tessera.config.DefaultKeyVaultConfig in project tessera by ConsenSys.
the class KeyVaultConfigValidatorTest method invalidAzureConfig.
@Test
public void invalidAzureConfig() {
DefaultKeyVaultConfig config = new DefaultKeyVaultConfig();
config.setKeyVaultType(KeyVaultType.AZURE);
assertThat(keyVaultConfigValidator.isValid(config, context)).isFalse();
}
use of com.quorum.tessera.config.DefaultKeyVaultConfig in project tessera by ConsenSys.
the class KeyVaultConfigValidatorTest method invalidAWSConfig.
@Test
public void invalidAWSConfig() {
DefaultKeyVaultConfig config = new DefaultKeyVaultConfig();
config.setKeyVaultType(KeyVaultType.AWS);
config.setProperty("endpoint", "noscheme");
assertThat(keyVaultConfigValidator.isValid(config, context)).isFalse();
}
Aggregations