/** * Create an instance of {@link OperationProvisioningScriptsType } * */ public OperationProvisioningScriptsType createOperationProvisioningScriptsType() { return new OperationProvisioningScriptsType(); }
/** * Create an instance of {@link OperationProvisioningScriptsType } * */ public OperationProvisioningScriptsType createOperationProvisioningScriptsType() { return new OperationProvisioningScriptsType(); }
/** * Create an instance of {@link OperationProvisioningScriptsType } * */ public OperationProvisioningScriptsType createOperationProvisioningScriptsType() { return new OperationProvisioningScriptsType(); }
public OperationProvisioningScriptsType beginScripts() { OperationProvisioningScriptsType value = new OperationProvisioningScriptsType(); scripts(value); return value; }
@Test public void test210ModifyAccountQuote() throws Exception { final String TEST_NAME = "test210ModifyAccountQuote"; TestUtil.displayTestTitle(TEST_NAME); Task task = taskManager.createTaskInstance(TestDummy.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_QUOTE_NAME), "eh?"); display("ObjectDelta", delta); delta.checkConsistence(); try { // WHEN provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); AssertJUnit.fail("Unexpected success"); } catch (SecurityViolationException e) { // This is expected display("Expected exception", e); } }
@Test public void test200ModifyAccountDrink() throws Exception { final String TEST_NAME = "test200ModifyAccountDrink"; TestUtil.displayTestTitle(TEST_NAME); Task task = taskManager.createTaskInstance(TestDummy.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME), "RUM"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); delta.checkConsistence(); assertDummyAccountAttributeValues(ACCOUNT_WILL_USERNAME, willIcfUid, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "RUM"); syncServiceMock.assertNotifySuccessOnly(); }
@Test public void test201ModifyAccountGossip() throws Exception { final String TEST_NAME = "test201ModifyAccountGossip"; TestUtil.displayTestTitle(TEST_NAME); Task task = taskManager.createTaskInstance(TestDummy.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME), "pirate"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); delta.checkConsistence(); assertDummyAccountAttributeValues(ACCOUNT_WILL_USERNAME, willIcfUid, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, "pirate"); syncServiceMock.assertNotifySuccessOnly(); }
@Test public void test416AssociateUserToCorsairs() throws Exception { final String TEST_NAME = "test416AssociateUserToCorsairs"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); ObjectDelta<ShadowType> delta = IntegrationTestTools.createEntitleDelta(ACCOUNT_MORGAN_OID, ASSOCIATION_GROUP_NAME, GROUP_CORSAIRS_OID, prismContext); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); Entry groupEntry = openDJController.fetchEntry(GROUP_CORSAIRS_DN); display("LDAP group", groupEntry); assertNotNull("No LDAP group entry"); openDJController.assertUniqueMember(groupEntry, ACCOUNT_MORGAN_DN); assertShadows(22); }
@Test public void test282DetitleAccountWillPirates() throws Exception { final String TEST_NAME = "test282DetitleAccountWillPirates"; TestUtil.displayTestTitle(TEST_NAME); Task task = taskManager.createTaskInstance(TestDummy.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = IntegrationTestTools.createDetitleDelta(ACCOUNT_WILL_OID, dummyResourceCtl.getAttributeQName(DummyResourceContoller.DUMMY_ENTITLEMENT_GROUP_NAME), GROUP_PIRATES_OID, prismContext); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); delta.checkConsistence(); DummyGroup group = getDummyGroupAssert(GROUP_PIRATES_NAME, piratesIcfUid); assertNoMember(group, getWillRepoIcfName()); // Make sure that account is still there and it has the privilege DummyAccount dummyAccount = getDummyAccountAssert(ACCOUNT_WILL_USERNAME, willIcfUid); assertNotNull("Account will is gone!", dummyAccount); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
new OperationProvisioningScriptsType(), null, task, result);
@Test public void test120ModifyWillReplaceFullname() throws Exception { final String TEST_NAME = "test120ModifyWillReplaceFullname"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributeFullnamePath(), "Pirate Will Turner"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); assertSuccess(result); delta.checkConsistence(); assertDummyAccount(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid) .assertAttribute(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, "Pirate Will Turner"); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
@Test public void test123ModifyObjectDeletePirate() throws Exception { final String TEST_NAME = "test123ModifyObjectDeletePirate"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationDeleteProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME), "Pirate"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); assertSuccess(result); delta.checkConsistence(); // check if attribute was changed assertDummyAccountAttributeValues(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Captain"); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
@Test public void test122ModifyObjectAddCaptain() throws Exception { final String TEST_NAME = "test122ModifyObjectAddCaptain"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationAddProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME), "Captain"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); assertSuccess(result); delta.checkConsistence(); // check if attribute was changed assertDummyAccountAttributeValues(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Pirate", "Captain"); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
new OperationProvisioningScriptsType(), null, task, result);
/** * Try to add the same value that the account attribute already has. Resources that do not tolerate this will fail * unless the mechanism to compensate for this works properly. */ @Test public void test124ModifyAccountWillAddCaptainAgain() throws Exception { final String TEST_NAME = "test124ModifyAccountWillAddCaptainAgain"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationAddProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME), "Captain"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); assertSuccess(result); delta.checkConsistence(); // check if attribute was changed assertDummyAccountAttributeValues(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Captain"); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
@Test public void test121ModifyObjectAddPirate() throws Exception { final String TEST_NAME = "test121ModifyObjectAddPirate"; displayTestTitle(TEST_NAME); Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); ObjectDelta<ShadowType> delta = prismContext.deltaFactory().object().createModificationAddProperty(ShadowType.class, ACCOUNT_WILL_OID, dummyResourceCtl.getAttributePath(DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME), "Pirate"); display("ObjectDelta", delta); delta.checkConsistence(); // WHEN displayWhen(TEST_NAME); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN displayThen(TEST_NAME); assertSuccess(result); delta.checkConsistence(); // check if attribute was changed assertDummyAccountAttributeValues(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid, DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Pirate"); syncServiceMock.assertNotifySuccessOnly(); assertSteadyResource(); }
delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result);
new OperationProvisioningScriptsType(), null, task, result);
new OperationProvisioningScriptsType(), null, task, result);
new OperationProvisioningScriptsType(), null, task, result);