use of com.evolveum.midpoint.test.ProvisioningScriptSpec in project midpoint by Evolveum.
the class TestDummy method test135ExecuteScript.
@Test
public void test135ExecuteScript() throws Exception {
final String TEST_NAME = "test135ExecuteScript";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestDummy.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
syncServiceMock.reset();
dummyResource.purgeScriptHistory();
OperationProvisioningScriptsType scriptsType = unmarshallValueFromFile(SCRIPTS_FILE, OperationProvisioningScriptsType.class);
display("Provisioning scripts", PrismTestUtil.serializeAnyDataWrapped(scriptsType));
ProvisioningScriptType script = scriptsType.getScript().get(0);
// WHEN
provisioningService.executeScript(RESOURCE_DUMMY_OID, script, task, result);
// THEN
result.computeStatus();
display("executeScript result", result);
TestUtil.assertSuccess("executeScript has failed (result)", result);
ProvisioningScriptSpec expectedScript = new ProvisioningScriptSpec("Where to go now?");
expectedScript.addArgMulti("direction", "left", "right");
IntegrationTestTools.assertScripts(dummyResource.getScriptHistory(), expectedScript);
assertSteadyResource();
}
Aggregations