|
1 | 1 | package io.split.engine.matchers; |
2 | 2 |
|
3 | 3 | import com.google.common.collect.Lists; |
4 | | -import com.google.common.collect.Sets; |
5 | 4 | import io.split.client.dtos.ConditionType; |
6 | 5 | import io.split.client.dtos.MatcherCombiner; |
7 | 6 | import io.split.client.dtos.SplitChange; |
|
14 | 13 | import io.split.engine.experiments.RuleBasedSegmentParser; |
15 | 14 | import io.split.engine.matchers.strings.WhitelistMatcher; |
16 | 15 | import io.split.storages.RuleBasedSegmentCache; |
17 | | -import io.split.storages.RuleBasedSegmentCacheConsumer; |
18 | 16 | import io.split.storages.SegmentCache; |
19 | 17 | import io.split.storages.memory.RuleBasedSegmentCacheInMemoryImp; |
20 | 18 | import io.split.storages.memory.SegmentCacheInMemoryImpl; |
21 | | -import okhttp3.mockwebserver.MockResponse; |
22 | 19 | import org.junit.Test; |
23 | 20 | import org.mockito.Mockito; |
24 | 21 |
|
|
29 | 26 | import java.util.ArrayList; |
30 | 27 | import java.util.Arrays; |
31 | 28 | import java.util.HashMap; |
32 | | -import java.util.Set; |
33 | 29 |
|
34 | 30 | import static io.split.client.utils.RuleBasedSegmentProcessor.processRuleBasedSegmentChanges; |
35 | 31 | import static org.hamcrest.Matchers.is; |
@@ -128,14 +124,14 @@ public void usingRbsInExcludedTest() throws IOException { |
128 | 124 | RuleBasedSegmentsToUpdate ruleBasedSegmentsToUpdate = processRuleBasedSegmentChanges(ruleBasedSegmentParser, |
129 | 125 | change.ruleBasedSegments.d); |
130 | 126 | ruleBasedSegmentCache.update(ruleBasedSegmentsToUpdate.getToAdd(), null, 123); |
131 | | - RuleBasedSegmentMatcher matcher = new RuleBasedSegmentMatcher("no_excludes"); |
| 127 | + RuleBasedSegmentMatcher matcher = new RuleBasedSegmentMatcher("sample_rule_based_segment"); |
132 | 128 | HashMap<String, Object> attrib1 = new HashMap<String, Object>() {{ |
133 | 129 | put("email", "mauro@split.io"); |
134 | 130 | }}; |
135 | 131 | HashMap<String, Object> attrib2 = new HashMap<String, Object>() {{ |
136 | | - put("email", "bilal@split.io"); |
| 132 | + put("email", "bilal@harness.io"); |
137 | 133 | }}; |
138 | | - assertThat(matcher.match("mauro@split.io", null, attrib1, evaluationContext), is(true)); |
139 | | - assertThat(matcher.match("bilal@split.io", null, attrib2, evaluationContext), is(true)); |
| 134 | + assertThat(matcher.match("mauro", null, attrib1, evaluationContext), is(false)); |
| 135 | + assertThat(matcher.match("bilal", null, attrib2, evaluationContext), is(true)); |
140 | 136 | } |
141 | 137 | } |
0 commit comments