5
5
import com .github .tomakehurst .wiremock .client .WireMock ;
6
6
import com .github .tomakehurst .wiremock .junit5 .WireMockRuntimeInfo ;
7
7
import com .github .tomakehurst .wiremock .junit5 .WireMockTest ;
8
- import dev .openfeature .sdk .Client ;
9
- import dev .openfeature .sdk .FlagEvaluationDetails ;
10
- import dev .openfeature .sdk .ImmutableContext ;
11
- import dev .openfeature .sdk .ImmutableMetadata ;
12
- import dev .openfeature .sdk .MutableContext ;
13
- import dev .openfeature .sdk .OpenFeatureAPI ;
14
- import dev .openfeature .sdk .ProviderEvaluation ;
15
- import dev .openfeature .sdk .ProviderEventDetails ;
16
- import dev .openfeature .sdk .ProviderState ;
17
8
import dev .openfeature .sdk .exceptions .GeneralError ;
18
9
import dev .openfeature .sdk .exceptions .ProviderNotReadyError ;
19
10
import lombok .SneakyThrows ;
25
16
import java .net .URL ;
26
17
import java .nio .file .Files ;
27
18
import java .nio .file .Paths ;
19
+ import java .util .HashMap ;
20
+ import java .util .Map ;
28
21
29
22
import static com .github .tomakehurst .wiremock .client .WireMock .aResponse ;
30
23
import static com .github .tomakehurst .wiremock .client .WireMock .equalTo ;
31
24
import static com .github .tomakehurst .wiremock .client .WireMock .post ;
32
25
import static com .github .tomakehurst .wiremock .client .WireMock .stubFor ;
33
26
import static com .github .tomakehurst .wiremock .client .WireMock .urlEqualTo ;
34
- import static org .junit .jupiter .api .Assertions .assertEquals ;
35
- import static org .junit .jupiter .api .Assertions .assertThrows ;
27
+ import static org .junit .jupiter .api .Assertions .*;
36
28
37
29
/**
38
30
* FliptProvider test, based on APIs mocking.
@@ -50,6 +42,8 @@ class FliptProviderTest {
50
42
public static final Double DOUBLE_FLAG_VALUE = 1.23 ;
51
43
public static final String USERS_FLAG_NAME = "users-flag" ;
52
44
public static final String TARGETING_KEY = "targeting_key" ;
45
+ public static final String OBJECT_FLAG_NAME = "object-flag" ;
46
+
53
47
private static FliptProvider fliptProvider ;
54
48
private static Client client ;
55
49
@@ -101,7 +95,6 @@ void getBooleanEvaluation() {
101
95
mockFliptAPI ("/evaluate/v1/boolean" , "boolean.json" , FLAG_NAME );
102
96
MutableContext evaluationContext = new MutableContext ();
103
97
evaluationContext .setTargetingKey (TARGETING_KEY );
104
- assertEquals (true , fliptProvider .getBooleanEvaluation (FLAG_NAME , false , evaluationContext ).getValue ());
105
98
assertEquals (true , client .getBooleanValue (FLAG_NAME , false , evaluationContext ));
106
99
assertEquals (false , client .getBooleanValue ("non-existing" , false , evaluationContext ));
107
100
}
@@ -171,7 +164,7 @@ void getEvaluationMetadataTest() {
171
164
assertEquals ("attachment-1" , flagMetadata .getString ("variant-attachment" ));
172
165
FlagEvaluationDetails <String > nonExistingFlagEvaluation = client .getStringDetails ("non-existing" , "" ,
173
166
evaluationContext );
174
- assertEquals ( null , nonExistingFlagEvaluation .getFlagMetadata ().getBoolean ("variant-attachment" ));
167
+ assertNull ( nonExistingFlagEvaluation .getFlagMetadata ().getBoolean ("variant-attachment" ));
175
168
}
176
169
177
170
@ SneakyThrows
0 commit comments