use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectsTest method testproceedDeleteAllEntity.
@Test
public void testproceedDeleteAllEntity() {
DummyEntity dummyEntity = new DummyEntity(new Secret(null, "path"));
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { List.of(dummyEntity) });
underTest.proceedOnRepositoryDeleteAll(proceedingJoinPoint);
verify(secretService, times(1)).delete(eq("path"));
}
use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectsTest method testproceedSaveEntityNotTenantAwareResource.
@Test
public void testproceedSaveEntityNotTenantAwareResource() throws Exception {
DummyEntity dummyEntity = new DummyEntity(new Secret(""));
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity });
thrown.expect(CloudbreakServiceException.class);
thrown.expectCause(any(IllegalArgumentException.class));
underTest.proceedOnRepositorySave(proceedingJoinPoint);
verifySecretManagementIgnoredDuringSave(null);
}
use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectsTest method testThrowCloudbreakServiceExceptionWhenEntityIsNotAccountIdAwareResource.
@Test
public void testThrowCloudbreakServiceExceptionWhenEntityIsNotAccountIdAwareResource() throws Exception {
DummyEntity dummyEntity = new DummyEntity(new Secret("secret"));
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity });
assertThrows(CloudbreakServiceException.class, () -> underTest.proceedOnRepositorySave(proceedingJoinPoint));
verifySecretManagementIgnoredDuringSave(dummyEntity.secret);
}
use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectsTest method testproceedSaveEntity.
@Test
public void testproceedSaveEntity() throws Exception {
DummyTenantAwareResourceEntity dummyEntity = new DummyTenantAwareResourceEntity(new Secret("raw"));
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity });
when(tenant.getName()).thenReturn("tenant");
underTest.proceedOnRepositorySave(proceedingJoinPoint);
verify(secretService, times(1)).put(anyString(), eq("raw"));
assertThat(dummyEntity.secret, IsInstanceOf.instanceOf(SecretProxy.class));
}
use of com.sequenceiq.cloudbreak.service.secret.domain.Secret in project cloudbreak by hortonworks.
the class SecretAspectsTest method testproceedDeleteEntity.
@Test
public void testproceedDeleteEntity() {
DummyEntity dummyEntity = new DummyEntity(new Secret(null, "path"));
when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity });
underTest.proceedOnRepositoryDelete(proceedingJoinPoint);
verify(secretService, times(1)).delete(eq("path"));
}
Aggregations