public <T> Collection<T> getAttributeValues(ShadowType shadow, javax.xml.namespace.QName attributeQname) { return ShadowUtil.getAttributeValues(shadow, attributeQname); }
public Collection<String> getAttributeStringValues(ShadowType shadow, javax.xml.namespace.QName attributeQname) { return ShadowUtil.getAttributeValues(shadow, attributeQname, String.class); }
protected <T> void assertAttribute(PrismObject<ResourceType> resource, ShadowType shadow, MatchingRule<T> matchingRule, QName attrQname, T... expectedValues) throws SchemaException { List<T> actualValues = ShadowUtil.getAttributeValues(shadow, attrQname); PrismAsserts.assertSets("attribute "+attrQname+" in " + shadow, matchingRule, actualValues, expectedValues); }
protected <T> void assertAttribute(PrismObject<ResourceType> resource, ShadowType shadow, QName attrQname, T... expectedValues) { List<T> actualValues = ShadowUtil.getAttributeValues(shadow, attrQname); PrismAsserts.assertSets("attribute "+attrQname+" in " + shadow, actualValues, expectedValues); }
public static <T> T getAttributeValue(PrismObject<? extends ShadowType> shadow, QName attrName) throws SchemaException { Collection<T> values = getAttributeValues(shadow, attrName); if (values == null || values.isEmpty()) { return null; } if (values.size() > 1) { throw new SchemaException("Attempt to get single value from multi-valued attribute "+attrName); } return values.iterator().next(); }
protected <T> void assertAttribute(PrismObject<ResourceType> resource, ShadowType shadow, QName attrQname, T... expectedValues) { List<T> actualValues = ShadowUtil.getAttributeValues(shadow, attrQname); PrismAsserts.assertSets("attribute "+attrQname+" in " + shadow, actualValues, expectedValues); }
protected <T> void assertAttribute(PrismObject<ResourceType> resource, ShadowType shadow, MatchingRule<T> matchingRule, QName attrQname, T... expectedValues) throws SchemaException { List<T> actualValues = ShadowUtil.getAttributeValues(shadow, attrQname); PrismAsserts.assertSets("attribute "+attrQname+" in " + shadow, matchingRule, actualValues, expectedValues); }
public static <T> List<T> getAttributeValues(ShadowType shadowType, QName attrName) { return getAttributeValues(shadowType.asPrismObject(), attrName); }
private void checkPrivBargain(PrismObject<ShadowType> shadow, OperationResult result) throws SchemaException { checkEntitlementShadow(shadow, result, OBJECTCLAS_PRIVILEGE_LOCAL_NAME, true); assertShadowName(shadow, PRIVILEGE_BARGAIN_NAME); assertEquals("Wrong kind (provisioning)", ShadowKindType.ENTITLEMENT, shadow.asObjectable().getKind()); Collection<ResourceAttribute<?>> attributes = ShadowUtil.getAttributes(shadow); assertEquals("Unexpected number of attributes", 2, attributes.size()); assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( shadow, new QName(SchemaConstants.NS_ICF_SCHEMA, "password"))); }
private void checkPrivPillage(PrismObject<ShadowType> shadow, OperationResult result) throws SchemaException { checkEntitlementShadow(shadow, result, OBJECTCLAS_PRIVILEGE_LOCAL_NAME, true); assertShadowName(shadow, PRIVILEGE_PILLAGE_NAME); assertEquals("Wrong kind (provisioning)", ShadowKindType.ENTITLEMENT, shadow.asObjectable().getKind()); Collection<ResourceAttribute<?>> attributes = ShadowUtil.getAttributes(shadow); assertEquals("Unexpected number of attributes", 3, attributes.size()); assertAttribute(shadow, DummyResourceContoller.DUMMY_PRIVILEGE_ATTRIBUTE_POWER, 100); assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( shadow, new QName(SchemaConstants.NS_ICF_SCHEMA, "password"))); }
private void checkGroupPirates(PrismObject<ShadowType> shadow, OperationResult result) throws SchemaException { checkGroupShadow(shadow, result); PrismAsserts.assertEqualsPolyString("Name not equal.", transformNameFromResource(GROUP_PIRATES_NAME), shadow.getName()); assertEquals("Wrong kind (provisioning)", ShadowKindType.ENTITLEMENT, shadow.asObjectable().getKind()); assertAttribute(shadow, DummyResourceContoller.DUMMY_GROUP_ATTRIBUTE_DESCRIPTION, "Scurvy pirates"); Collection<ResourceAttribute<?>> attributes = ShadowUtil.getAttributes(shadow); assertEquals("Unexpected number of attributes", 3, attributes.size()); assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( shadow, new QName(SchemaConstants.NS_ICF_SCHEMA, "password"))); }
List<Object> snValues = ShadowUtil.getAttributeValues(accountType, new QName(RESOURCE_NS, "sn")); assertNotNull("No 'sn' attribute", snValues); assertFalse("Surname attributes must not be empty", snValues.isEmpty());
assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( provisioningAccountType, new QName(SchemaConstants.NS_ICF_SCHEMA, "password")));
XmlTypeConverter.createXMLGregorianCalendar(ZonedDateTime.parse(ACCOUNT_MORGAN_PASSWORD_ENLIST_TIMESTAMP))); assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( provisioningAccountType, new QName(SchemaConstants.NS_ICF_SCHEMA, "password")));
assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( accountTypeProvisioning, new QName(SchemaConstants.NS_ICF_SCHEMA, "password")));
assertEntitlementPriv(provisioningAccount, PRIVILEGE_PILLAGE_OID); assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( provisioningAccount, new QName(SchemaConstants.NS_ICF_SCHEMA, "password")));
assertNull("The _PASSSWORD_ attribute sneaked into shadow", ShadowUtil.getAttributeValues( accountTypeProvisioning, new QName(SchemaConstants.NS_ICF_SCHEMA, "password")));