### Question:
ContextsStorageSecurityAspect { @Before("execution(* ContextDataStorage.update(java.util.UUID, com.jaspersoft.jasperserver.remote.connection.storage.ContextDataPair)) ||" + "execution(* ContextDataStorage.get(java.util.UUID)) ||" + "execution(* ContextDataStorage.delete(java.util.UUID))" ) public void checkOwner(JoinPoint joinPoint){ final UUID uuid = (UUID) joinPoint.getArgs()[0]; final Element element = getElement(uuid); if(element != null){ final Object pair = element.getObjectValue(); if(pair != null){ if(!(pair instanceof OwnedContextDataPair && getCurrentUserQualifiedName().equals(((OwnedContextDataPair) pair).getOwner()))){ throw new AccessDeniedException(uuid.toString()); } } } }  @Around("execution(* ContextDataStorage.save(com.jaspersoft.jasperserver.remote.connection.storage.ContextDataPair))") Object saveOwnedContext(ProceedingJoinPoint joinPoint); @Around("execution(* ContextDataStorage.update(java.util.UUID, com.jaspersoft.jasperserver.remote.connection.storage.ContextDataPair))") void updateOwnedContext(ProceedingJoinPoint joinPoint); @Before("execution(* ContextDataStorage.update(java.util.UUID, com.jaspersoft.jasperserver.remote.connection.storage.ContextDataPair)) ||" + "execution(* ContextDataStorage.get(java.util.UUID)) ||" + "execution(* ContextDataStorage.delete(java.util.UUID))" ) void checkOwner(JoinPoint joinPoint);  }### Answer:
@Test public void checkOwner_noSuchEntry_noException(){ final JoinPoint joinPoint = mock(JoinPoint.class); final UUID uuid = UUID.randomUUID(); when(joinPoint.getArgs()).thenReturn(new Object[]{uuid}); doCallRealMethod().when(aspect).checkOwner(joinPoint); Exception exception = null; try { aspect.checkOwner(joinPoint); } catch (Exception e){ exception = e; } assertNull(exception); }