### Question:
SecretAspects { @Around("onRepositoryDelete()") public Object proceedOnRepositoryDelete(ProceedingJoinPoint proceedingJoinPoint) { return proceedDelete(proceedingJoinPoint); }  @Pointcut("execution(* com.sequenceiq.cloudbreak.repository..*.save(..)) ") void onRepositorySave(); @Pointcut("execution(void com.sequenceiq.cloudbreak.repository..*.delete(..)) ") void onRepositoryDelete(); @Pointcut("execution(* com.sequenceiq.cloudbreak.repository..*.saveAll(..)) ") void onRepositorySaveAll(); @Pointcut("execution(void com.sequenceiq.cloudbreak.repository..*.deleteAll(..)) ") void onRepositoryDeleteAll(); @Around("onRepositorySave()") Object proceedOnRepositorySave(ProceedingJoinPoint proceedingJoinPoint); @Around("onRepositoryDelete()") Object proceedOnRepositoryDelete(ProceedingJoinPoint proceedingJoinPoint); @Around("onRepositorySaveAll()") Object proceedOnRepositorySaveAll(ProceedingJoinPoint proceedingJoinPoint); @Around("onRepositoryDeleteAll()") Object proceedOnRepositoryDeleteAll(ProceedingJoinPoint proceedingJoinPoint);  }### Answer:
@Test public void testproceedDeleteEntityNotContainsSecret() { when(proceedingJoinPoint.getArgs()).thenReturn(new String[] { "test" }); underTest.proceedOnRepositoryDelete(proceedingJoinPoint); }
@Test public void testproceedDeleteEntityPathIsNull() { DummyEntity dummyEntity = new DummyEntity(null); when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity }); underTest.proceedOnRepositoryDelete(proceedingJoinPoint); verify(secretService, times(0)).delete(anyString()); }
@Test public void testproceedDeleteEntitySecretIsNull() { DummyEntity dummyEntity = new DummyEntity(new Secret(null, null)); when(proceedingJoinPoint.getArgs()).thenReturn(new Object[] { dummyEntity }); underTest.proceedOnRepositoryDelete(proceedingJoinPoint); verify(secretService, times(0)).delete(anyString()); }
@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")); }