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; }
public ShadowAsserter<RA> assertCorpse() { assertDead(); assertIsNotExists(); return this; }
public static ShadowAsserter<Void> forShadow(PrismObject<ShadowType> shadow, String details) { return new ShadowAsserter<>(shadow, details); }
public ShadowAsserter<RA> assertConception() { assertNotDead(); assertIsNotExists(); return this; }
public ShadowAsserter<RA> assertLife() { assertNotDead(); assertIsExists(); return this; }
ShadowAsserter shadowAsserter = ShadowAsserter.forShadow(repoShadow, "repository"); shadowAsserter .display() .pendingOperations() .assertOperations(2) .modifyOperation() .assertModify(); shadowAsserter .assertBasicRepoProperties() .assertKind(ShadowKindType.ACCOUNT) .assertIsExists() .assertNotDead() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME, SchemaConstants.ICFS_UID); shadowAsserter = ShadowAsserter.forShadow(shadowNoFetch, "noFetch"); shadowAsserter .display() .pendingOperations() .assertOperations(2) .modifyOperation() .assertModify(); shadowAsserter .assertIsExists() .assertNotDead() .assertNoLegacyConsistency()
ShadowAsserter.forShadow(conflictingShadowRepo,"confligting repo shadow") .display() .assertBasicRepoProperties() .assertOid(shadowMorganOid) .assertName(ACCOUNT_MORGAN_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertNotDead() .assertIsExists() .pendingOperations() .assertNone(); .assertNoDelta() .oldShadow() .assertOid(shadowMorganOid) .assertName(ACCOUNT_MORGAN_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertNotDead() .assertIsExists() .attributes() .assertHasPrimaryIdentifier() .assertHasSecondaryIdentifier() .end() .pendingOperations() .assertNone() .end() .end() .assertUnrelatedChange(false) .assertProtected(false) .currentShadow()
.end() .oldShadow() .assertOid(ACCOUNT_ELIZABETH_OID) .assertName(ACCOUNT_ELIZABETH_USERNAME) .assertKind(ShadowKindType.ACCOUNT) .assertTombstone() .attributes() .assertHasPrimaryIdentifier() .assertHasSecondaryIdentifier() .end() .pendingOperations() .assertNone() .end() .end() .currentShadow() .assertOid(ACCOUNT_ELIZABETH_OID) .assertName(ACCOUNT_ELIZABETH_USERNAME) .assertKind(ShadowKindType.ACCOUNT) .assertTombstone(); .assertDead() .assertIsNotExists() .pendingOperations() .assertNone();
assertSuccess(result); ShadowAsserter.forShadow(shadowModel, "model") .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertNotDead() .assertIsExists() .assertAdministrativeStatus(ActivationStatusType.ENABLED) .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertValue(ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME) .assertNotDead() .assertIsExists() .pendingOperations() .singleOperation() .assertRequestTimestamp(accountWillReqestTimestampStart, accountWillReqestTimestampEnd) .end() .end() .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertNoAttribute(ATTR_DESCRIPTION_QNAME) .end() .assertNoPassword() .getObject(); assertAttributeFromCache(shadowRepo, ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME); assertShadowActivationAdministrativeStatusFromCache(shadowRepo, ActivationStatusType.ENABLED);
.assertKind(ShadowKindType.ACCOUNT) .assertIsNotExists() .assertNotDead() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME) .end() .pendingOperations() .singleOperation() .display() .assertIsNotExists() .assertNotDead() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertSize(1) .end() .pendingOperations() .singleOperation() .assertType(PendingOperationTypeType.RETRY) .assertIsExists() .assertNotDead() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer()
ShadowAsserter.forShadow(shadowRepo, "repo") .display() .pendingOperations() .assertNone(); ShadowAsserter.forShadow(shadowProvisioning, "provisioning") .display() .pendingOperations() .assertNone();
assertSuccess(result); ShadowAsserter.forShadow(shadowModel, "model") .display() .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertAdministrativeStatus(ActivationStatusType.ENABLED) .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertValue(ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME_PIRATE); .pendingOperations() .assertOperations(3); .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertAdministrativeStatus(ActivationStatusType.ENABLED) .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertValue(ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME_PIRATE) .end() .getObject(); assertAttributeFromBackingStore(shadowModelFuture, ATTR_DESCRIPTION_QNAME, ACCOUNT_WILL_DESCRIPTION_MANUAL);
assertSuccess(result); ShadowAsserter<Void> shadowModelAsserter = ShadowAsserter.forShadow(shadowModel, "model") .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertAdministrativeStatus(ActivationStatusType.ENABLED) .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertValue(ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME_PIRATE) .end() .pendingOperations() .assertOperations(2) .end(); .pendingOperations() .assertOperations(2); .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertAdministrativeStatus(ActivationStatusType.ENABLED) .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .assertValue(ATTR_FULLNAME_QNAME, USER_WILL_FULL_NAME_PIRATE)
.end() .oldShadow() .assertOid(shadowMorganOid) .assertName(ACCOUNT_MORGAN_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertTombstone() .attributes() .assertHasPrimaryIdentifier() .assertHasSecondaryIdentifier() .end() .pendingOperations() .assertNone() .end() .end() .currentShadow() .assertOid(shadowMorganOid) .assertName(ACCOUNT_MORGAN_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertTombstone(); .assertTombstone() .pendingOperations() .assertNone(); ShadowAsserter.forShadow(provisioningShadow, "provisioning") .assertTombstone();
ShadowAsserter shadowAsserter = ShadowAsserter.forShadow(repoShadow, "repository"); shadowAsserter .display() .pendingOperations() .assertOperations(expectenNumberOfPendingOperations) .by() .assertDelete(); shadowAsserter .assertBasicRepoProperties() .assertKind(ShadowKindType.ACCOUNT) .assertTombstone() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME, SchemaConstants.ICFS_UID); .assertTombstone() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertHasPrimaryIdentifier() .assertSize(2) .end() .pendingOperations() .assertOperations(expectenNumberOfPendingOperations) .by() .assertTombstone();
.assertKind(ShadowKindType.ACCOUNT) .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME) .end() .pendingOperations() .assertNone(); .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertSize(1) .end() .pendingOperations() .assertNone(); .assertTombstone() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertTombstone()
ShadowAsserter.forShadow(repoShadow, "repo") .display() .assertName(ACCOUNT_WILL_DN) .pendingOperations() .singleOperation() .assertExecutionStatus(PendingOperationExecutionStatusType.EXECUTING) ShadowAsserter.forShadow(provisioningAccountFuture, "future") .display() .assertName(ACCOUNT_WILL_DN) .assertIsExists() .assertNotDead();
.pendingOperations() .singleOperation() .display() .end() .end() .assertBasicRepoProperties() .assertKind(ShadowKindType.ACCOUNT) .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertAttributes(SchemaConstants.ICFS_NAME); .pendingOperations() .singleOperation() .assertRequestTimestamp(lastRequestStartTs, lastRequestEndTs) .end() .end() .assertDead() .assertIsNotExists() .assertNoLegacyConsistency() .attributes() .assertResourceAttributeContainer() .assertNoPrimaryIdentifier() .assertDead() .assertIsNotExists()
protected void assertAccountWillAfterAssign(final String TEST_NAME, String expectedFullName, PendingOperationExecutionStatusType propagationExecutionStage) throws Exception { ShadowAsserter<Void> shadowRepoAsserter = assertRepoShadow(accountWillOid) .assertConception() .pendingOperations() .singleOperation() .assertId() .end() .end() .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .end() .assertNoPassword(); assertAttributeFromCache(shadowRepoAsserter, ATTR_FULLNAME_QNAME, expectedFullName); assertShadowActivationAdministrativeStatusFromCache(shadowRepoAsserter.getObject(), ActivationStatusType.ENABLED); .assertName(USER_WILL_NAME) .assertKind(ShadowKindType.ACCOUNT) .assertConception() .attributes() .assertValue(ATTR_USERNAME_QNAME, USER_WILL_NAME) .end() .assertNoPassword() .pendingOperations() .singleOperation() .assertRequestTimestamp(accountWillReqestTimestampStart, accountWillReqestTimestampEnd) .end(); assertAttributeFromCache(shadowModelAsserter, ATTR_FULLNAME_QNAME, expectedFullName);
.assertProtected(false) .currentShadow() .assertOidDifferentThan(ACCOUNT_ELIZABETH_OID) .assertName(ACCOUNT_ELIZABETH_USERNAME) .assertKind(ShadowKindType.ACCOUNT) .assertNotDead() .assertIsExists() .attributes() .assertHasPrimaryIdentifier() .assertHasSecondaryIdentifier() .assertValue(dummyResourceCtl.getAttributeFullnameQName(), ACCOUNT_ELIZABETH2_FULLNAME) .end() .pendingOperations() .assertNone();