use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretTestUtil method setSecretField.
public static void setSecretField(Class<?> clazz, String fieldName, Object target, String raw, String secret) {
Field field = ReflectionUtils.findField(clazz, fieldName);
field.setAccessible(true);
try {
field.set(target, new Secret(raw, secret));
} catch (IllegalAccessException ignore) {
}
}
use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectServiceTest method testVaultDeleteWhenAccountIdDefinedThenMustWriteTheRightPath.
@Test
public void testVaultDeleteWhenAccountIdDefinedThenMustWriteTheRightPath() throws Exception {
VaultTest vaultTest = new VaultTest("justice-league", new Secret("super", "justice-league/vaulttest/power/123-123-123-123"));
VaultTestProceedingJoinPoint proceedingJoinPoint = new VaultTestProceedingJoinPoint(vaultTest);
ArgumentCaptor<String> keyCaptor = ArgumentCaptor.forClass(String.class);
doNothing().when(secretService).delete(keyCaptor.capture());
underTest.proceedDelete(proceedingJoinPoint);
Assert.assertTrue(keyCaptor.getValue().startsWith("justice-league/vaulttest/power/123-123-123-123"));
}
Aggregations