@Override protected boolean handleObject(PrismObject<ShadowType> object, Task workerTask, OperationResult result) throws CommonException { LOGGER.trace("Refreshing {}", object); provisioningService.refreshShadow(object, null, workerTask, result); LOGGER.trace("Refreshed {}", object); return true; } };
/** * Attempt to refresh shadow with failed operation. Nothing should happen. */ @Test public void test179RefreshAccountMorganFailed() throws Exception { final String TEST_NAME = "test179RefreshAccountMorganFailed"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); clockForward("PT17M"); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertMorganDeleteFailed(); }
/** * Refresh while the resource is down. Retry interval is not yet reached. * Nothing should really happen yet. */ @Test public void test104RefreshAccountMorganCommunicationFailure() throws Exception { final String TEST_NAME = "test104RefreshAccountMorganCommunicationFailure"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertUncreatedMorgan(1); assertSteadyResources(); }
/** * Attempt to refresh dead shadow. Nothing should happen. */ @Test public void test109RefreshAccountMorganDead() throws Exception { final String TEST_NAME = "test109RefreshAccountMorganDead"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); clockForward("PT17M"); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertMorganDead(); }
/** * Attempt to refresh shadow with failed operation. Nothing should happen. */ @Test public void test129RefreshAccountMorganFailed() throws Exception { final String TEST_NAME = "test129RefreshAccountMorganFailed"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); clockForward("PT17M"); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertMorganModifyFailed(); }
/** * Refresh while the resource is down. Retry interval is not yet reached. * Nothing should really happen yet. */ @Test public void test124RefreshAccountMorganCommunicationFailure() throws Exception { final String TEST_NAME = "test124RefreshAccountMorganCommunicationFailure"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertUnmodifiedMorgan(1, 2, ACCOUNT_MORGAN_FULLNAME_HM); assertSteadyResources(); }
/** * Refresh while the resource is down. Retry interval is not yet reached. * Nothing should really happen yet. */ @Test public void test174RefreshAccountMorganCommunicationFailure() throws Exception { final String TEST_NAME = "test174RefreshAccountMorganCommunicationFailure"; displayTestTitle(TEST_NAME); // GIVEN Task task = createTask(TEST_NAME); OperationResult result = task.getResult(); syncServiceMock.reset(); dummyResource.setBreakMode(BreakMode.NETWORK); PrismObject<ShadowType> shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN displayWhen(TEST_NAME); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN displayThen(TEST_NAME); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); assertUndeletedMorgan(1, 4); assertSteadyResources(); }
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);
provisioningService.refreshShadow(shadowRepoBefore, null, task, result);