list = provisioning.listResourceObjects(resourceOid, objectClass, paging, task, result);
/** * This is using the shadow to go to the resource. But it cannot as OpenDJ is down. * Therefore the expected result is CommunicationException. It must not be ObjectNotFound as * we do NOT know that the shadow does not exist. */ @Test public void test520ListResourceObjects() throws Exception { final String TEST_NAME = "test520ListResourceObjects"; displayTestTitle(TEST_NAME); // GIVEN OperationResult result = new OperationResult(TestOpenDjNegative.class.getName() + "." + TEST_NAME); try { // WHEN List<PrismObject<? extends ShadowType>> objectList = provisioningService.listResourceObjects( RESOURCE_OPENDJ_OID, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS, null, null, result); AssertJUnit.fail("listResourceObjects succeeded unexpectedly"); } catch (CommunicationException e) { // This is expected display("Expected exception", e); } assertFailure(result); }
@Test public void test120ListResourceObjects() throws Exception { final String TEST_NAME = "test120ListResourceObjects"; displayTestTitle(TEST_NAME); // GIVEN OperationResult result = new OperationResult(TestOpenDjNegative.class.getName() + "." + TEST_NAME); try { // WHEN List<PrismObject<? extends ShadowType>> objectList = provisioningService.listResourceObjects( RESOURCE_OPENDJ_OID, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS, null, null, result); AssertJUnit.fail("listResourceObjects succeeded unexpectedly"); } catch (ConfigurationException e) { // This is expected display("Expected exception", e); } result.computeStatus(); TestUtil.assertFailure(result); }
@Test public void test020ListResourceObjects() throws Exception { final String TEST_NAME = "test020ListResourceObjects"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); // WHEN List<PrismObject<? extends ShadowType>> objectList = provisioningService.listResourceObjects( RESOURCE_OPENDJ_OID, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS, null, task, result); // THEN assertNotNull(objectList); assertFalse("Empty list returned",objectList.isEmpty()); display("Resource object list "+RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS,objectList); assertShadows(1 + getNumberOfBaseContextShadows()); }