@Override public boolean hasProperty(String s) throws RepositoryException { return dlg.hasProperty(s); }
@Override public boolean hasProperty(final String relPath) throws RepositoryException { return delegate.hasProperty(relPath); }
@Override public boolean hasProperty(String s) throws RepositoryException { return dlg.hasProperty(s); }
@Override public boolean hasProperty(String s) throws RepositoryException { return dlg.hasProperty(s); }
@NotNull @Override public Boolean perform() throws RepositoryException { return delegate.hasProperty(relPath); } });
@Nonnull @Override public Boolean perform() throws RepositoryException { return delegate.hasProperty(relPath); } });
@NotNull @Override public Boolean perform() throws RepositoryException { return delegate.hasProperty(relPath); } });
private static String getAuthorizableEmail(Authorizable authorizable) throws RepositoryException { if (authorizable.hasProperty(PN_USER_EMAIL)) { Value[] emailVal = authorizable.getProperty(PN_USER_EMAIL); return emailVal[0].getString(); } return null; }
private static String getAuthorizableEmail(Authorizable authorizable) throws RepositoryException { if (authorizable.hasProperty(PN_USER_EMAIL)) { Value[] emailVal = authorizable.getProperty(PN_USER_EMAIL); return emailVal[0].getString(); } return null; }
public boolean hasProperty(String name) throws RepositoryException { return user.hasProperty(name); }
private boolean checkIfAuthHasProperty(boolean execute, ActionResult actionResult, Authorizable authorizable) throws RepositoryException { if (!authorizable.hasProperty(propertyName)) { actionResult.logError("Authorizable " + authorizableId + ": no such property: " + propertyName); if (execute) { actionResult.logError(ActionUtils.ASSERTION_FAILED_MSG); } return false; } return true; }
private boolean checkIfAuthHasProperty(boolean execute, ActionResult actionResult, Authorizable authorizable) throws RepositoryException { if (!authorizable.hasProperty(propertyName)) { actionResult.logError("Authorizable " + authorizableId + ": no such property: " + propertyName); if (execute) { actionResult.logError(ActionUtils.ASSERTION_FAILED_MSG); } return false; } return true; }
@Test public void testHasProperty2() throws Exception { for (String relPath : unmappedPaths) { try { authorizable.hasProperty(relPath); fail(); } catch (RepositoryException e) { // success } } }
@Test public void testHasProperty() throws Exception { for (String relPath : mappedPaths) { assertTrue(authorizable.hasProperty(relPath)); } }
public void testGetNotExistingProperty() throws RepositoryException, NotExecutableException { Authorizable auth = getTestUser(superuser); String hint = "Fullname"; String propName = hint; int i = 0; while (auth.hasProperty(propName)) { propName = hint + i; i++; } assertNull(auth.getProperty(propName)); assertFalse(auth.hasProperty(propName)); }
@Test public void testSyncPropertiesEmptyMap() throws Exception { ExternalUser externalUser = idp.getUser(TestIdentityProvider.ID_SECOND_USER); Authorizable a = syncCtx.createUser(externalUser); syncCtx.syncProperties(externalUser, a, ImmutableMap.<String, String>of()); for (String propName : externalUser.getProperties().keySet()) { assertFalse(a.hasProperty(propName)); } }
public void testRemoveNotExistingProperty() throws RepositoryException, NotExecutableException { Authorizable auth = getTestUser(superuser); String hint = "Fullname"; String propName = hint; int i = 0; while (auth.hasProperty(propName)) { propName = hint + i; i++; } assertFalse(auth.removeProperty(propName)); save(superuser); }
@Test public void testSyncPropertiesEmptyMapExistingProps() throws Exception { ExternalUser externalUser = idp.getUser(TestIdentityProvider.ID_SECOND_USER); Authorizable a = syncCtx.createUser(externalUser); Value anyValue = valueFactory.createValue("any"); Map<String, ?> extProps = externalUser.getProperties(); for (String propName : extProps.keySet()) { a.setProperty(propName, anyValue); } syncCtx.syncProperties(externalUser, a, ImmutableMap.<String, String>of()); for (String propName : extProps.keySet()) { assertTrue(a.hasProperty(propName)); assertEquals(anyValue, a.getProperty(propName)[0]); } }
@Test public void testSyncMembershipForExternalGroup() throws Exception { ExternalGroup externalGroup = idp.getGroup("a"); // a group that has declaredGroups SyncContext ctx = new DefaultSyncContext(syncConfig, idp, userManager, valueFactory); ctx.sync(externalGroup); ctx.close(); r.commit(); Authorizable gr = userManager.getAuthorizable(externalGroup.getId()); syncContext.syncMembership(externalGroup, gr, 1); assertFalse(gr.hasProperty(ExternalIdentityConstants.REP_EXTERNAL_PRINCIPAL_NAMES)); assertFalse(r.hasPendingChanges()); }
@Override public void before() throws Exception { super.before(); testUserPath = getTestUser().getPath(); // force an external user to be synchronized into the repo login(new SimpleCredentials(USER_ID, new char[0])).close(); root.refresh(); Authorizable a = getUserManager(root).getAuthorizable(USER_ID); assertNotNull(a); assertEquals(isDynamic(), a.hasProperty(ExternalIdentityConstants.REP_EXTERNAL_PRINCIPAL_NAMES)); externalUserPath = a.getPath(); }