### Question:
ContextsStorageSecurityAspect { protected OwnedContextDataPair getOwnedDataPair(ContextDataPair source){ final String userQualifiedName = getCurrentUserQualifiedName(); return (OwnedContextDataPair) new OwnedContextDataPair(source.getContext(), source.getData(), userQualifiedName).setExternalContextClass(source.getExternalContextClass()); }  @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 getOwnedDataPair(){ final Object connection = new Object(); final HashMap<String, Object> data = new HashMap<String, Object>(); final ContextDataPair pair = new ContextDataPair(connection, data); when(aspect.getCurrentUserQualifiedName()).thenReturn("someOwnerUser"); when(aspect.getOwnedDataPair(pair)).thenCallRealMethod(); final ContextsStorageSecurityAspect.OwnedContextDataPair result = aspect.getOwnedDataPair(pair); assertNotNull(result); assertSame(result.getContext(), connection); assertSame(result.getData(), data); assertEquals(result.getOwner(), "someOwnerUser"); }