Skip to content

Commit

Permalink
Add answers for new methods in RecordStore interface [HZ-4131] (hazel…
Browse files Browse the repository at this point in the history
…cast#280)

RecordStoreAnswer handles answers from proxied HazelcastInstance's
ICache / IMap record stores in compatibility tests. This commit adds
support for newly introduced methods after/beforeOperation in the IMap
RecordStore interface, so they can be safely invoked in compatibility
tests.
Fixes constant test failures in HDMapSplitBrainCompatibilityTest and
HDMapSetTtlBackupCompatibilityTest

GitOrigin-RevId: 0b48832586cc6a123865bbe3e218da4a6d8b92f0
  • Loading branch information
vbekiaris authored and actions-user committed Dec 22, 2023
1 parent 016f54e commit d42b2e0
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ Object answer(InvocationOnMock invocation, String methodName, Object[] arguments
} else if (arguments.length == 2 && methodName.equals("get")) {
// ICacheRecordStore
return getCacheValue(methodName, arguments);
} else if (arguments.length == 0 && methodName.equals("getReadOnlyRecords")) {
// ICacheRecordStore
return invoke(invocation);
} else if (arguments.length == 0 && methodName.equals("size")) {
return invoke(invocation);
} else if (arguments.length == 0) {
switch (methodName) {
case "beforeOperation":
case "afterOperation":
return null;
case "size":
case "getReadOnlyRecords":
return invoke(invocation);
}
}
throw new UnsupportedOperationException("Method is not implemented in RecordStoreAnswer: " + methodName);
}
Expand Down

0 comments on commit d42b2e0

Please sign in to comment.