@Test public void test120SearchAccountByUsernameJack() throws Exception { TestUtil.displayTestTile(this, "test120SearchAccountByUsernameJack"); // GIVEN Task task = taskManager.createTaskInstance( TestModelServiceContract.class.getName() + ".test120SearchAccountByUsernameJack"); OperationResult result = task.getResult(); PrismObject<ResourceType> resource = modelService.getObject(ResourceType.class, RESOURCE_CSVFILE_BROKEN_OID, null, task, result); try { // WHEN PrismObject<ShadowType> account = findAccountByUsername("jack", resource, task, result); AssertJUnit.fail("Expected SystemException but the operation was successful"); } catch (SystemException e) { // This is expected result.computeStatus(); display("findAccountByUsername result", result); TestUtil.assertFailure("findAccountByUsername result", result); } }
@Test public void test100GetAccountMurray() throws Exception { TestUtil.displayTestTile(this, "test100GetAccountMurray"); // GIVEN Task task = taskManager.createTaskInstance( TestModelServiceContract.class.getName() + ".test100GetAccountMurray"); OperationResult result = task.getResult(); try { // WHEN PrismObject<ShadowType> account = modelService.getObject( ShadowType.class, ACCOUNT_SHADOW_MURRAY_CSVFILE_OID, null, task, result); AssertJUnit.fail("Expected SystemException but the operation was successful"); } catch (SystemException e) { // This is expected display("Expected exception", e); result.computeStatus(); display("getObject result", result); TestUtil.assertFailure("getObject result", result); } }
@Test public void test310TestResourceNoJars() throws Exception { TestUtil.displayTestTile(this, "test310TestResourceNoJars"); // GIVEN Task task = taskManager.createTaskInstance( TestModelServiceContract.class.getName() + ".test310TestResourceNoJars"); // WHEN OperationResult testResult = modelService.testResource(RESOURCE_DUMMY_NOJARS_OID, task); // THEN display("testResource result", testResult); TestUtil.assertFailure("testResource result", testResult); }
@Test public void test210TestResourceNotFound() throws Exception { TestUtil.displayTestTile(this, "test210TestResourceNotFound"); // GIVEN Task task = taskManager.createTaskInstance( TestModelServiceContract.class.getName() + ".test210TestResourceNotFound"); OperationResult result = task.getResult(); // WHEN OperationResult testResult = modelService.testResource(RESOURCE_CSVFILE_NOTFOUND_OID, task); // THEN display("testResource result", testResult); TestUtil.assertFailure("testResource result", testResult); }