use of com.evolveum.midpoint.provisioning.impl.ProvisioningContext in project midpoint by Evolveum.
the class AbstractBasicDummyTest method test080TestAttributesToReturn.
// The account must exist to test this with modify delta. So we postpone the
// test when the account actually exists
@Test
public void test080TestAttributesToReturn() throws Exception {
final String TEST_NAME = "test080TestAttributesToReturn";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance();
OperationResult result = task.getResult();
ResourceShadowDiscriminator coords = new ResourceShadowDiscriminator(RESOURCE_DUMMY_OID, ShadowKindType.ENTITLEMENT, RESOURCE_DUMMY_INTENT_GROUP);
ProvisioningContext ctx = provisioningContextFactory.create(coords, task, result);
// WHEN
AttributesToReturn attributesToReturn = ProvisioningUtil.createAttributesToReturn(ctx);
// THEN
display("attributesToReturn", attributesToReturn);
assertFalse("wrong isReturnDefaultAttributes", attributesToReturn.isReturnDefaultAttributes());
Collection<String> attrs = new ArrayList<>();
for (ResourceAttributeDefinition attributeToReturnDef : attributesToReturn.getAttributesToReturn()) {
attrs.add(attributeToReturnDef.getName().getLocalPart());
}
// No "memebers" attribute here
PrismAsserts.assertSets("Wrong attribute to return", attrs, "uid", "name", "description", "cc");
assertSteadyResource();
}
Aggregations