InternalSecurity implements Serializable { @Secures @Owner public boolean ownerChecker(Identity identity, @Current OwnableEntity item) { return identity.isLoggedIn() && (StringUtils.isEmpty(item.getCreator()) || identityManager.lookupById(User.class, identity.getAccount().getId()).getLoginName().equals(item.getCreator())); }  @Secures @Admin boolean adminChecker(Identity identity); @Secures @TsLoggedIn boolean loginChecker(Identity identity); @Secures @Owner boolean ownerChecker(Identity identity, @Current OwnableEntity item); @Secures @DepricatedView boolean depricate(Identity identity);  }
@Test public void testOwnerChecker_1() throws Exception { InternalSecurity fixture = new InternalSecurity(); Identity identity = new DefaultIdentity(); OwnableEntity item = new ColumnPreferences(); boolean result = fixture.ownerChecker(identity, item); assertTrue(!result); }
@Test public void testOwnerChecker_2() throws Exception { InternalSecurity fixture = new InternalSecurity(); Identity identity = new DefaultIdentity(); OwnableEntity item = new ColumnPreferences(); boolean result = fixture.ownerChecker(identity, item); assertTrue(!result); }
@Test public void testOwnerChecker_3() throws Exception { InternalSecurity fixture = new InternalSecurity(); Identity identity = new DefaultIdentity(); OwnableEntity item = new ColumnPreferences(); boolean result = fixture.ownerChecker(identity, item); assertTrue(!result); }
@Test public void testOwnerChecker_4() throws Exception { InternalSecurity fixture = new InternalSecurity(); Identity identity = new DefaultIdentity(); OwnableEntity item = new ColumnPreferences(); boolean result = fixture.ownerChecker(identity, item); assertTrue(!result); }