@Test(expected = AuthorizationException.class) public void testFailedPerformSecurityCheck() { final Long tabId = new Long(1); context.checking(new Expectations() { { oneOf(principalMock).getAccountId(); will(returnValue("testUser")); oneOf(tabPermissionMock).canDeleteStartPageTab("testUser", tabId, true); will(throwException(new AuthorizationException())); } }); ServiceActionContext currentContext = new ServiceActionContext(tabId, principalMock); sut.authorize(currentContext); context.assertIsSatisfied(); }
@Override public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException { tabPermission.canDeleteStartPageTab(inActionContext.getPrincipal().getAccountId(), (Long) inActionContext .getParams(), true); }
DeleteTabAuthorization implements AuthorizationStrategy<PrincipalActionContext> { @Override public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException { tabPermission.canDeleteStartPageTab(inActionContext.getPrincipal().getAccountId(), (Long) inActionContext .getParams(), true); } }
DeleteTabAuthorization implements AuthorizationStrategy<PrincipalActionContext> { @Override public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException { tabPermission.canDeleteStartPageTab(inActionContext.getPrincipal().getAccountId(), (Long) inActionContext .getParams(), true); } DeleteTabAuthorization(final TabPermission inTabPermission); }
DeleteTabAuthorization implements AuthorizationStrategy<PrincipalActionContext> { @Override public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException { tabPermission.canDeleteStartPageTab(inActionContext.getPrincipal().getAccountId(), (Long) inActionContext .getParams(), true); } DeleteTabAuthorization(final TabPermission inTabPermission); @Override void authorize(final PrincipalActionContext inActionContext); }
DeleteTabAuthorization implements AuthorizationStrategy<PrincipalActionContext> { @Override public void authorize(final PrincipalActionContext inActionContext) throws AuthorizationException { tabPermission.canDeleteStartPageTab(inActionContext.getPrincipal().getAccountId(), (Long) inActionContext .getParams(), true); } DeleteTabAuthorization(final TabPermission inTabPermission); @Override void authorize(final PrincipalActionContext inActionContext);  }