@Test public void testCanRenameTabFailWithFalse() { final long tabIdToDelete = 9L; context.checking(new Expectations() { { oneOf(tabPermissionMapper).execute(TEST_USER_ACCOUNTID, tabIdToDelete); will(returnValue(false)); } }); Assert.assertFalse(sut.canModifyGadgets(TEST_USER_ACCOUNTID, new Long(tabIdToDelete), false)); context.assertIsSatisfied(); }
public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException) { AuthorizationException exception = throwException ? new AuthorizationException( "Insufficient permissions to modify gadgets on tab.") : null; return isCurrentUserStartTab(inAccountId, inTabId, exception); }
TabPermission { public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException) { AuthorizationException exception = throwException ? new AuthorizationException( "Insufficient permissions to modify gadgets on tab.") : null; return isCurrentUserStartTab(inAccountId, inTabId, exception); } }
TabPermission { public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException) { AuthorizationException exception = throwException ? new AuthorizationException( "Insufficient permissions to modify gadgets on tab.") : null; return isCurrentUserStartTab(inAccountId, inTabId, exception); } TabPermission(final GetTabPermissionByPersonAndTab inTabPermissionsMapper); }
TabPermission { public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException) { AuthorizationException exception = throwException ? new AuthorizationException( "Insufficient permissions to modify gadgets on tab.") : null; return isCurrentUserStartTab(inAccountId, inTabId, exception); } TabPermission(final GetTabPermissionByPersonAndTab inTabPermissionsMapper); boolean canDeleteStartPageTab(final String inAccountId, final Long inTabId, final boolean throwException); boolean canChangeTabLayout(final String inAccountId, final Long inTabId, final boolean throwException); boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException); boolean canRenameTab(final String inAccountId, final Long inTabId, final boolean throwException); }
TabPermission { public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException) { AuthorizationException exception = throwException ? new AuthorizationException( "Insufficient permissions to modify gadgets on tab.") : null; return isCurrentUserStartTab(inAccountId, inTabId, exception); } TabPermission(final GetTabPermissionByPersonAndTab inTabPermissionsMapper); boolean canDeleteStartPageTab(final String inAccountId, final Long inTabId, final boolean throwException); boolean canChangeTabLayout(final String inAccountId, final Long inTabId, final boolean throwException); boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException); boolean canRenameTab(final String inAccountId, final Long inTabId, final boolean throwException);  }