Skip to content

Commit 1881107

Browse files
committed
Fix EvaluatorTest by using real CombiningMatcher instead of mock
PowerMock 1.7.4 cannot mock final classes on Java 8+. Instead of using PowerMock, create a real CombiningMatcher instance with AllKeysMatcher, which is a simple value object suitable for testing. Removes PowerMock incompatibility without requiring API migration. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> AI-Session-Id: c83b3557-2c02-4d13-aaa4-273b7340163d AI-Tool: claude-code AI-Model: unknown
1 parent 3c9b6f4 commit 1881107

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

client/src/test/java/io/split/engine/evaluator/EvaluatorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.util.ArrayList;
1919
import java.util.Arrays;
20+
import java.util.Collections;
2021
import java.util.HashMap;
2122
import java.util.HashSet;
2223
import java.util.List;
@@ -50,7 +51,7 @@ public void before() {
5051
_segmentCacheConsumer = Mockito.mock(SegmentCacheConsumer.class);
5152
_ruleBasedSegmentCacheConsumer = Mockito.mock(RuleBasedSegmentCacheConsumer.class);
5253
_evaluator = new EvaluatorImp(_splitCacheConsumer, _segmentCacheConsumer, _ruleBasedSegmentCacheConsumer, new FallbackTreatmentCalculatorImp(null));
53-
_matcher = Mockito.mock(CombiningMatcher.class);
54+
_matcher = CombiningMatcher.of(new io.split.rules.matchers.AllKeysMatcher());
5455
_evaluationContext = Mockito.mock(EvaluationContext.class);
5556

5657
_configurations = new HashMap<>();

0 commit comments

Comments
 (0)