Skip to content

Commit

Permalink
Adapt TestImportRecon to recent changes
Browse files Browse the repository at this point in the history
After letting Synchronizer propagate protected accounts' sync events
to SynchronizationServiceImpl (7971415,
point #3), the "objects processed" and "shadow fetched" counters went
down (because protected shadows are no longer re-processed in 3rd stage
of reconciliation).

TestImportRecon had to be adapted.
  • Loading branch information
mederly committed Mar 7, 2023
1 parent 1910ece commit ea760e8
Showing 1 changed file with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -985,22 +985,22 @@ public void test200ReconcileDummy() throws Exception {
.activityState(RECONCILIATION_REMAINING_SHADOWS_PATH)
.itemProcessingStatistics()
.display()
.assertTotalCounts(0, 0, 2)
.assertTotalCounts(0, 0, 0)
.end()
.progress()
.display()
.assertCommitted(0, 0, 2)
.assertNoCommitted()
.assertNoUncommitted()
.end()
.end()
.assertProgress(9);
.assertProgress(7);
// @formatter:on

and("given number of fetch operations should be there");
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6);
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 4);

and("reconciliation result listener should contain correct counters");
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 2);
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0);

and("users should be as expected");
List<PrismObject<UserType>> users = modelService.searchObjects(UserType.class, null, null, task, result);
Expand Down Expand Up @@ -1165,9 +1165,9 @@ public void test219ReconcileDummyFixed() throws Exception {

dumpStatistics(taskAfter);

assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6);
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 4);

reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 2);
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0);

List<PrismObject<UserType>> users = modelService.searchObjects(UserType.class, null, null, task, result);
display("Users after import", users);
Expand Down Expand Up @@ -1274,7 +1274,7 @@ public void test220ReconcileDummyBrokenGuybrush() throws Exception {
List<PrismObject<UserType>> users = modelService.searchObjects(UserType.class, null, null, task, result);
display("Users after reconciliation (broken resource account)", users);

reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 1, 2);
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 1, 0);

assertImportedUserByOid(USER_ADMINISTRATOR_OID);
assertImportedUserByOid(USER_JACK_OID);
Expand Down Expand Up @@ -1346,9 +1346,9 @@ public void test229ReconcileDummyFixed() throws Exception {

dumpStatistics(taskAfter);

assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6);
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 4);

reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 2);
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0);

List<PrismObject<UserType>> users = modelService.searchObjects(UserType.class, null, null, task, result);
display("Users after import", users);
Expand Down Expand Up @@ -1464,27 +1464,26 @@ public void test230ReconcileDummyRename() throws Exception {
// for ht (old name for htm)
.assertTransition(LINKED, DELETED, DELETED, null, 1, 0, 0)
// two protected accounts (daviejones, calypso)
.assertTransition(null, null, null, PROTECTED, 0, 0, 2)
.assertTransitions(2)
.assertTransitions(1)
.end()
.itemProcessingStatistics()
.display()
.assertTotalCounts(1, 0, 2) // 1 renamed, 2 protected
.assertTotalCounts(1, 0, 0) // 1 renamed
.end()
.progress()
.display()
.assertCommitted(1, 0, 2)
.assertCommitted(1, 0, 0)
.assertNoUncommitted()
.end()
.end()
.assertProgress(10);
.assertProgress(8);
// @formatter:on

dumpShadowSituations(RESOURCE_DUMMY_OID, result);

assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6);
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 4);

reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 3);
reconciliationResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 1);

List<PrismObject<UserType>> users = modelService.searchObjects(UserType.class, null, null, task, result);
display("Users after import", users);
Expand Down

0 comments on commit ea760e8

Please sign in to comment.