Search in sources :

Example 51 with GetOperationOptions

use of com.evolveum.midpoint.schema.GetOperationOptions in project midpoint by Evolveum.

the class AbstractManualResourceTest method test109GetAccountWillFutureNoFetch.

@Test
public void test109GetAccountWillFutureNoFetch() throws Exception {
    final String TEST_NAME = "test109GetAccountWillFutureNoFetch";
    displayTestTile(TEST_NAME);
    // GIVEN
    Task task = createTask(TEST_NAME);
    OperationResult result = task.getResult();
    GetOperationOptions options = GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE);
    options.setNoFetch(true);
    // WHEN
    displayWhen(TEST_NAME);
    PrismObject<ShadowType> shadowProvisioningFuture = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, SelectorOptions.createCollection(options), task, result);
    // THEN
    displayThen(TEST_NAME);
    assertSuccess(result);
    display("Provisioning shadow (future,noFetch)", shadowProvisioningFuture);
    assertNotNull("no OID", shadowProvisioningFuture.getOid());
    ShadowType shadowTypeProvisioning = shadowProvisioningFuture.asObjectable();
    assertShadowName(shadowProvisioningFuture, ACCOUNT_WILL_USERNAME);
    assertEquals("Wrong kind (provisioning)", ShadowKindType.ACCOUNT, shadowTypeProvisioning.getKind());
    assertAttribute(shadowProvisioningFuture, ATTR_USERNAME_QNAME, ACCOUNT_WILL_USERNAME);
    assertAttributeFromCache(shadowProvisioningFuture, ATTR_FULLNAME_QNAME, ACCOUNT_WILL_FULLNAME);
    assertNoAttribute(shadowProvisioningFuture, ATTR_DESCRIPTION_QNAME);
    assertShadowActivationAdministrativeStatusFromCache(shadowProvisioningFuture, ActivationStatusType.ENABLED);
    assertShadowExists(shadowProvisioningFuture, true);
// TODO
//		assertShadowPassword(shadowProvisioningFuture);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) GetOperationOptions(com.evolveum.midpoint.schema.GetOperationOptions) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) AbstractProvisioningIntegrationTest(com.evolveum.midpoint.provisioning.impl.AbstractProvisioningIntegrationTest)

Example 52 with GetOperationOptions

use of com.evolveum.midpoint.schema.GetOperationOptions in project midpoint by Evolveum.

the class AbstractManualResourceTest method test303GetAccountWillFutureNoFetch.

@Test
public void test303GetAccountWillFutureNoFetch() throws Exception {
    final String TEST_NAME = "test303GetAccountWillFutureNoFetch";
    displayTestTile(TEST_NAME);
    // GIVEN
    Task task = createTask(TEST_NAME);
    OperationResult result = task.getResult();
    GetOperationOptions options = GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE);
    options.setNoFetch(true);
    // WHEN
    displayWhen(TEST_NAME);
    PrismObject<ShadowType> shadowProvisioningFuture = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, SelectorOptions.createCollection(options), task, result);
    // THEN
    displayThen(TEST_NAME);
    assertSuccess(result);
    display("Provisioning shadow (future,noFetch)", shadowProvisioningFuture);
    assertNotNull("no OID", shadowProvisioningFuture.getOid());
    assertShadowName(shadowProvisioningFuture, ACCOUNT_WILL_USERNAME);
    assertShadowDead(shadowProvisioningFuture);
    assertNoShadowPassword(shadowProvisioningFuture);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) GetOperationOptions(com.evolveum.midpoint.schema.GetOperationOptions) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) AbstractProvisioningIntegrationTest(com.evolveum.midpoint.provisioning.impl.AbstractProvisioningIntegrationTest)

Aggregations

GetOperationOptions (com.evolveum.midpoint.schema.GetOperationOptions)52 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)38 SelectorOptions (com.evolveum.midpoint.schema.SelectorOptions)31 Task (com.evolveum.midpoint.task.api.Task)22 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)19 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)19 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)13 Collection (java.util.Collection)12 PrismObject (com.evolveum.midpoint.prism.PrismObject)11 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)11 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)11 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)11 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)10 SecurityViolationException (com.evolveum.midpoint.util.exception.SecurityViolationException)10 QName (javax.xml.namespace.QName)10 Test (org.testng.annotations.Test)10 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)9 ArrayList (java.util.ArrayList)9 ResultHandler (com.evolveum.midpoint.schema.ResultHandler)8 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)7