26
26
import io .split .grammar .Treatments ;
27
27
import io .split .telemetry .storage .InMemoryTelemetryStorage ;
28
28
import io .split .telemetry .storage .TelemetryStorage ;
29
+ import org .junit .Assert ;
29
30
import org .junit .Test ;
30
31
import org .mockito .Mockito ;
31
32
38
39
39
40
import static org .hamcrest .Matchers .equalTo ;
40
41
import static org .hamcrest .Matchers .is ;
41
- import static org .hamcrest .Matchers .nullValue ;
42
42
import static org .junit .Assert .assertThat ;
43
43
44
44
/**
@@ -50,6 +50,7 @@ public class SplitParserTest {
50
50
51
51
public static final String EMPLOYEES = "employees" ;
52
52
public static final String SALES_PEOPLE = "salespeople" ;
53
+ public static final int CONDITIONS_UPPER_LIMIT = 50 ;
53
54
private static final TelemetryStorage TELEMETRY_STORAGE = Mockito .mock (InMemoryTelemetryStorage .class );
54
55
55
56
@ Test
@@ -176,7 +177,7 @@ public void works_for_two_conditions() {
176
177
}
177
178
178
179
@ Test
179
- public void fails_for_long_conditions () {
180
+ public void success_for_long_conditions () {
180
181
SDKReadinessGates gates = new SDKReadinessGates ();
181
182
SegmentCache segmentCache = new SegmentCacheInMemoryImpl ();
182
183
segmentCache .updateSegment (EMPLOYEES , Stream .of ("adil" , "pato" , "trevor" ).collect (Collectors .toList ()), new ArrayList <>());
@@ -193,14 +194,14 @@ public void fails_for_long_conditions() {
193
194
194
195
List <Condition > conditions = Lists .newArrayList ();
195
196
List <Partition > p1 = Lists .newArrayList (ConditionsTestUtil .partition ("on" , 100 ));
196
- for (int i = 0 ; i < SplitParser . CONDITIONS_UPPER_LIMIT +1 ; i ++) {
197
+ for (int i = 0 ; i < CONDITIONS_UPPER_LIMIT +1 ; i ++) {
197
198
Condition c = ConditionsTestUtil .and (employeesMatcher , p1 );
198
199
conditions .add (c );
199
200
}
200
201
201
202
Split split = makeSplit ("first.name" , 123 , conditions , 1 );
202
203
203
- assertThat (parser .parse (split ), is ( nullValue () ));
204
+ Assert . assertNotNull (parser .parse (split ));
204
205
}
205
206
206
207
0 commit comments