Search in sources :

Example 1 with ShadowAsserter

use of com.evolveum.midpoint.test.asserter.ShadowAsserter in project midpoint by Evolveum.

the class TestDelivery method test200assignOpenDJBob.

@Test
public void test200assignOpenDJBob() throws Exception {
    displayTestTitle(getTestName());
    Task task = getTestTask();
    OperationResult result = task.getResult();
    assignRole(userBobOid, ROLE_OPENDJ_OID);
    PrismObject<UserType> userBobAfter = modelService.getObject(UserType.class, userBobOid, getOperationOptionsBuilder().item(UserType.F_JPEG_PHOTO).retrieve().build(), task, result);
    assertUser(userBobAfter, "after").assertLiveLinks(1).assignments().assertRole(ROLE_OPENDJ_OID);
    PrismObject<ShadowType> shadow = findShadowByNameViaModel(ShadowKindType.ACCOUNT, "default", "uid=bob,ou=People,dc=example,dc=com", resourceOpenDj, null, task, result);
    assertNotNull(shadow);
    bobShadowOid = shadow.getOid();
    new ShadowAsserter<>(shadow).attributes().assertNoAttribute(ATTR_JPEG_PHOTO);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ShadowAsserter(com.evolveum.midpoint.test.asserter.ShadowAsserter) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test)

Aggregations

OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 ShadowAsserter (com.evolveum.midpoint.test.asserter.ShadowAsserter)1 Test (org.testng.annotations.Test)1