@@ -71,19 +71,15 @@ void init() {
71
71
cnPhoneNumber = new FBUser .Builder ("18555358000" ).userName ("test-user-5" ).build ();
72
72
frPhoneNumber = new FBUser .Builder ("0603111111" ).userName ("test-user-6" ).build ();
73
73
email =
new FBUser .
Builder (
"[email protected] " ).
userName (
"test-user-7" ).
build ();
74
- fakeConfigBuilder = new FBConfig .Builder ()
75
- .streamingURL (fakeUrl )
76
- .eventURL (fakeUrl );
74
+ fakeConfigBuilder = new FBConfig .Builder ().streamingURL (fakeUrl ).eventURL (fakeUrl );
77
75
initFuture = support .createNiceMock (Future .class );
78
76
dataSynchronizer = support .createNiceMock (DataSynchronizer .class );
79
77
insightProcessor = support .createNiceMock (InsightProcessor .class );
80
78
dataStorage = support .createNiceMock (DataStorage .class );
81
79
}
82
80
83
81
private FBClient createMockClient (FBConfig .Builder config ) {
84
- config .dataSynchronizerFactory (mockDataSynchronizerFactory (dataSynchronizer ))
85
- .insightProcessorFactory (mockInsightProcessorFactory (insightProcessor ))
86
- .dataStorageFactory (mockDataStorageFactory (dataStorage ));
82
+ config .dataSynchronizerFactory (mockDataSynchronizerFactory (dataSynchronizer )).insightProcessorFactory (mockInsightProcessorFactory (insightProcessor )).dataStorageFactory (mockDataStorageFactory (dataStorage ));
87
83
return new FBClientImp (fakeEnvSecret , config .build ());
88
84
}
89
85
@@ -187,7 +183,11 @@ void testAllLatestFlagsVariations() throws IOException {
187
183
assertEquals (true , ed1 .getVariation ());
188
184
assertEquals (REASON_TARGET_MATCH , ed1 .getReason ());
189
185
EvalDetail <Integer > ed2 = states .getIntegerDetail ("ff-test-number" , 0 );
186
+ Long longValue = states .getLong ("ff-test-number" , 0L );
187
+ Double doubleValue = states .getDouble ("ff-test-number" , 0D );
190
188
assertEquals (1 , ed2 .getVariation ());
189
+ assertEquals (1L , longValue );
190
+ assertEquals (1D , doubleValue );
191
191
assertEquals (REASON_RULE_MATCH , ed2 .getReason ());
192
192
EvalDetail <String > ed3 = states .getStringDetail ("ff-test-string" , "" );
193
193
assertEquals ("others" , ed3 .getVariation ());
@@ -283,10 +283,7 @@ void testConstructIllegalEnvSecret() throws IOException {
283
283
284
284
@ Test
285
285
void testConstructEmptyUrl () throws IOException {
286
- FBConfig errorConfig = new FBConfig .Builder ()
287
- .streamingURL ("" )
288
- .eventURL ("" )
289
- .build ();
286
+ FBConfig errorConfig = new FBConfig .Builder ().streamingURL ("" ).eventURL ("" ).build ();
290
287
try (FBClient client = new FBClientImp (fakeEnvSecret , errorConfig )) {
291
288
fail ("illegal argument exception" );
292
289
} catch (IllegalArgumentException e ) {
@@ -296,10 +293,7 @@ void testConstructEmptyUrl() throws IOException {
296
293
297
294
@ Test
298
295
void testConstructIllegalUrl () throws IOException {
299
- FBConfig errorConfig = new FBConfig .Builder ()
300
- .streamingURL ("urn:isbn:0-294-56559-3" )
301
- .
eventURL (
"mailto:[email protected] " )
302
- .build ();
296
+ FBConfig errorConfig =
new FBConfig .
Builder ().
streamingURL (
"urn:isbn:0-294-56559-3" ).
eventURL (
"mailto:[email protected] " ).
build ();
303
297
try (FBClient client = new FBClientImp (fakeEnvSecret , errorConfig )) {
304
298
fail ("illegal argument exception" );
305
299
} catch (IllegalArgumentException e ) {
0 commit comments