From d42b2e0ccd5388e4964d007650a0dd5c3131476c Mon Sep 17 00:00:00 2001 From: Vassilis Bekiaris Date: Fri, 22 Dec 2023 14:06:24 +0200 Subject: [PATCH] Add answers for new methods in RecordStore interface [HZ-4131] (#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 --- .../test/starter/answer/RecordStoreAnswer.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hazelcast/src/test/java/com/hazelcast/test/starter/answer/RecordStoreAnswer.java b/hazelcast/src/test/java/com/hazelcast/test/starter/answer/RecordStoreAnswer.java index 3c88c66f7ea5..d92750cc7f33 100644 --- a/hazelcast/src/test/java/com/hazelcast/test/starter/answer/RecordStoreAnswer.java +++ b/hazelcast/src/test/java/com/hazelcast/test/starter/answer/RecordStoreAnswer.java @@ -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); }