public static PendingOperationsAsserter<Void> forShadow(PrismObject<ShadowType> shadow) { return new PendingOperationsAsserter<>(ShadowAsserter.forShadow(shadow)); }
protected ShadowAsserter<Void> assertModelShadow(String oid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { PrismObject<ShadowType> repoShadow = getShadowModel(oid); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(repoShadow, "model"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertShadow(PrismObject<ShadowType> shadow, String details) throws ObjectNotFoundException, SchemaException { ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(shadow, details); initializeAsserter(asserter); asserter.display(); return asserter; }
protected ShadowAsserter<Void> assertModelShadowNoFetch(String oid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { PrismObject<ShadowType> repoShadow = getShadowModelNoFetch(oid); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(repoShadow, "model(noFetch)"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertModelShadowFuture(String oid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { PrismObject<ShadowType> repoShadow = getShadowModelFuture(oid); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(repoShadow, "model(future)"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertShadow(String username, PrismObject<ResourceType> resource) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException { ObjectQuery query = createAccountShadowQuery(username, resource); OperationResult result = new OperationResult("assertShadow"); List<PrismObject<ShadowType>> accounts = repositoryService.searchObjects(ShadowType.class, query, null, result); if (accounts.isEmpty()) { AssertJUnit.fail("No shadow for "+username+" on "+resource); } else if (accounts.size() > 1) { AssertJUnit.fail("Too many shadows for "+username+" on "+resource+" ("+accounts.size()+"): "+accounts); } ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(accounts.get(0), "shadow for username "+username+" on "+resource); initializeAsserter(asserter); asserter.display(); return asserter; }
protected ShadowAsserter<Void> assertModelShadowFutureNoFetch(String oid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException { GetOperationOptions options = GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE); options.setNoFetch(true); PrismObject<ShadowType> repoShadow = getShadowModel(oid, options, true); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(repoShadow, "model(future,noFetch)"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertShadowProvisioning(String oid) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { Task task = createTask("assertShadowProvisioning"); OperationResult result = task.getResult(); PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, oid, null, task, result); assertSuccess(result); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(shadow, "provisioning"); asserter .display(); return asserter; }
protected void assertWillRepoShadowAfterCreate(PrismObject<ShadowType> repoShadow) { ShadowAsserter.forShadow(repoShadow, "repo") .assertActiveLifecycleState() .pendingOperations() .singleOperation() .assertExecutionStatus(PendingOperationExecutionStatusType.COMPLETED) .delta() .assertAdd(); }
/** * Let's try to fetch object that does exit in the repository but does not * exist in the resource. */ @Test public void test112GetObjectNotFoundResource() throws Exception { final String TEST_NAME = "test112GetObjectNotFoundResource"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN displayWhen(TEST_NAME); PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_BAD_OID, null, task, result); // THEN displayWhen(TEST_NAME); ShadowAsserter.forShadow(shadow, "provisioning") .assertTombstone(); }
protected ShadowAsserter<Void> assertShadowNoFetch(String oid) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { Task task = createTask("assertShadowProvisioning"); OperationResult result = task.getResult(); Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch()); PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, oid, options, task, result); assertSuccess(result); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(shadow, "noFetch"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertShadowFuture(String oid) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { Task task = createTask("assertShadowFuture"); OperationResult result = task.getResult(); Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)); PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, oid, options, task, result); assertSuccess(result); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(shadow, "future"); asserter .display(); return asserter; }
protected ShadowAsserter<Void> assertShadowFutureNoFetch(String oid) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException { Task task = createTask("assertShadowFutureNoFetch"); OperationResult result = task.getResult(); GetOperationOptions rootOptions = GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE); rootOptions.setNoFetch(true); Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(rootOptions); PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, oid, options, task, result); assertSuccess(result); ShadowAsserter<Void> asserter = ShadowAsserter.forShadow(shadow, "future,noFetch"); asserter .display(); return asserter; } }
ShadowAsserter.forShadow(shadow) .assertDead() .assertIsNotExists();