Search in sources :

Example 1 with ProvisioningContext

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();
}
Also used : ProvisioningContext(com.evolveum.midpoint.provisioning.impl.ProvisioningContext) AttributesToReturn(com.evolveum.midpoint.provisioning.ucf.api.AttributesToReturn) Task(com.evolveum.midpoint.task.api.Task) ResourceAttributeDefinition(com.evolveum.midpoint.schema.processor.ResourceAttributeDefinition) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ResourceShadowDiscriminator(com.evolveum.midpoint.schema.ResourceShadowDiscriminator) Test(org.testng.annotations.Test)

Aggregations

ProvisioningContext (com.evolveum.midpoint.provisioning.impl.ProvisioningContext)1 AttributesToReturn (com.evolveum.midpoint.provisioning.ucf.api.AttributesToReturn)1 ResourceShadowDiscriminator (com.evolveum.midpoint.schema.ResourceShadowDiscriminator)1 ResourceAttributeDefinition (com.evolveum.midpoint.schema.processor.ResourceAttributeDefinition)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1