@Test public void testProceedWhenProceedingJoinPointProceedReturnsNullThenItShouldHaveLoggedWithMethodSignatureCallAndNullReturnsAtTheEnd() throws Throwable { when(proceedingJoinPoint.proceed()).thenReturn(null); Object result = underTest.proceed(proceedingJoinPoint, methodSignature, 0L); Assert.assertNull(result); verify(methodSignature, times(1)).toLongString(); verify(proceedingJoinPoint, times(1)).proceed(); }
public Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime) { LOGGER.debug("Permission check took {} ms (method: {})", System.currentTimeMillis() - startTime, methodSignature.getMethod().getDeclaringClass().getSimpleName() + "#" + methodSignature.getMethod().getName()); try { Object proceed = proceedingJoinPoint.proceed(); if (proceed == null) { LOGGER.debug("Return value is null, method signature: {}", methodSignature.toLongString()); } return proceed; } catch (Error | RuntimeException unchecked) { throw unchecked; } catch (Throwable t) { throw new AccessDeniedException(t.getMessage(), t); } }
CommonPermissionCheckingUtils { public Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime) { LOGGER.debug("Permission check took {} ms (method: {})", System.currentTimeMillis() - startTime, methodSignature.getMethod().getDeclaringClass().getSimpleName() + "#" + methodSignature.getMethod().getName()); try { Object proceed = proceedingJoinPoint.proceed(); if (proceed == null) { LOGGER.debug("Return value is null, method signature: {}", methodSignature.toLongString()); } return proceed; } catch (Error | RuntimeException unchecked) { throw unchecked; } catch (Throwable t) { throw new AccessDeniedException(t.getMessage(), t); } } }
CommonPermissionCheckingUtils { public Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime) { LOGGER.debug("Permission check took {} ms (method: {})", System.currentTimeMillis() - startTime, methodSignature.getMethod().getDeclaringClass().getSimpleName() + "#" + methodSignature.getMethod().getName()); try { Object proceed = proceedingJoinPoint.proceed(); if (proceed == null) { LOGGER.debug("Return value is null, method signature: {}", methodSignature.toLongString()); } return proceed; } catch (Error | RuntimeException unchecked) { throw unchecked; } catch (Throwable t) { throw new AccessDeniedException(t.getMessage(), t); } }  }
CommonPermissionCheckingUtils { public Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime) { LOGGER.debug("Permission check took {} ms (method: {})", System.currentTimeMillis() - startTime, methodSignature.getMethod().getDeclaringClass().getSimpleName() + "#" + methodSignature.getMethod().getName()); try { Object proceed = proceedingJoinPoint.proceed(); if (proceed == null) { LOGGER.debug("Return value is null, method signature: {}", methodSignature.toLongString()); } return proceed; } catch (Error | RuntimeException unchecked) { throw unchecked; } catch (Throwable t) { throw new AccessDeniedException(t.getMessage(), t); } }  @PostConstruct void init(); boolean legacyAuthorizationNeeded(); ResourceBasedCrnProvider getResourceBasedCrnProvider(AuthorizationResourceAction action); void checkPermissionForUser(AuthorizationResourceAction action, String userCrn); void checkPermissionForUserOnResource(Map<String, AuthorizationResourceAction> resourcesWithActions, String userCrn); void checkPermissionForUserOnResource(AuthorizationResourceAction action, String userCrn, String resourceCrn); void checkPermissionForUserOnResources(AuthorizationResourceAction action,
            String userCrn, Collection<String> resourceCrns); Map<String, Boolean> getPermissionsForUserOnResources(AuthorizationResourceAction action,
            String userCrn, List<String> resourceCrns); Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime); boolean isAuthorizationDisabled(ProceedingJoinPoint proceedingJoinPoint); boolean isInternalOnly(ProceedingJoinPoint proceedingJoinPoint); T getParameter(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, Class annotation, Class<T> target); }
CommonPermissionCheckingUtils { public Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime) { LOGGER.debug("Permission check took {} ms (method: {})", System.currentTimeMillis() - startTime, methodSignature.getMethod().getDeclaringClass().getSimpleName() + "#" + methodSignature.getMethod().getName()); try { Object proceed = proceedingJoinPoint.proceed(); if (proceed == null) { LOGGER.debug("Return value is null, method signature: {}", methodSignature.toLongString()); } return proceed; } catch (Error | RuntimeException unchecked) { throw unchecked; } catch (Throwable t) { throw new AccessDeniedException(t.getMessage(), t); } }  @PostConstruct void init(); boolean legacyAuthorizationNeeded(); ResourceBasedCrnProvider getResourceBasedCrnProvider(AuthorizationResourceAction action); void checkPermissionForUser(AuthorizationResourceAction action, String userCrn); void checkPermissionForUserOnResource(Map<String, AuthorizationResourceAction> resourcesWithActions, String userCrn); void checkPermissionForUserOnResource(AuthorizationResourceAction action, String userCrn, String resourceCrn); void checkPermissionForUserOnResources(AuthorizationResourceAction action,
            String userCrn, Collection<String> resourceCrns); Map<String, Boolean> getPermissionsForUserOnResources(AuthorizationResourceAction action,
            String userCrn, List<String> resourceCrns); Object proceed(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, long startTime); boolean isAuthorizationDisabled(ProceedingJoinPoint proceedingJoinPoint); boolean isInternalOnly(ProceedingJoinPoint proceedingJoinPoint); T getParameter(ProceedingJoinPoint proceedingJoinPoint, MethodSignature methodSignature, Class annotation, Class<T> target);  }