1
- package dev .openfeature .sdk .e2e ;
1
+ package dev .openfeature .sdk .e2e . evaluation ;
2
2
3
3
import dev .openfeature .sdk .Value ;
4
4
import dev .openfeature .sdk .EvaluationContext ;
@@ -52,7 +52,7 @@ public class StepDefinitions {
52
52
53
53
@ SneakyThrows
54
54
@ BeforeAll ()
55
- @ Given ("an openfeature client is registered with cache disabled " )
55
+ @ Given ("a provider is registered" )
56
56
public static void setup () {
57
57
Map <String , Flag <?>> flags = buildFlags ();
58
58
InMemoryProvider provider = new InMemoryProvider (flags );
@@ -67,7 +67,7 @@ public static void setup() {
67
67
// boolean value
68
68
@ When ("a boolean flag with key {string} is evaluated with default value {string}" )
69
69
public void a_boolean_flag_with_key_boolean_flag_is_evaluated_with_default_value_false (String flagKey ,
70
- String defaultValue ) {
70
+ String defaultValue ) {
71
71
this .booleanFlagValue = client .getBooleanValue (flagKey , Boolean .valueOf (defaultValue ));
72
72
}
73
73
@@ -117,7 +117,7 @@ public void an_object_flag_with_key_is_evaluated_with_a_null_default_value(Strin
117
117
118
118
@ Then ("the resolved object value should be contain fields {string}, {string}, and {string}, with values {string}, {string} and {int}, respectively" )
119
119
public void the_resolved_object_value_should_be_contain_fields_and_with_values_and_respectively (String boolField ,
120
- String stringField , String numberField , String boolValue , String stringValue , int numberValue ) {
120
+ String stringField , String numberField , String boolValue , String stringValue , int numberValue ) {
121
121
Structure structure = this .objectFlagValue .asStructure ();
122
122
123
123
assertEquals (Boolean .valueOf (boolValue ), structure .asMap ().get (boolField ).asBoolean ());
@@ -132,7 +132,7 @@ public void the_resolved_object_value_should_be_contain_fields_and_with_values_a
132
132
// boolean details
133
133
@ When ("a boolean flag with key {string} is evaluated with details and default value {string}" )
134
134
public void a_boolean_flag_with_key_is_evaluated_with_details_and_default_value (String flagKey ,
135
- String defaultValue ) {
135
+ String defaultValue ) {
136
136
this .booleanFlagDetails = client .getBooleanDetails (flagKey , Boolean .valueOf (defaultValue ));
137
137
}
138
138
@@ -148,13 +148,13 @@ public void the_resolved_boolean_value_should_be_the_variant_should_be_and_the_r
148
148
// string details
149
149
@ When ("a string flag with key {string} is evaluated with details and default value {string}" )
150
150
public void a_string_flag_with_key_is_evaluated_with_details_and_default_value (String flagKey ,
151
- String defaultValue ) {
151
+ String defaultValue ) {
152
152
this .stringFlagDetails = client .getStringDetails (flagKey , defaultValue );
153
153
}
154
154
155
155
@ Then ("the resolved string details value should be {string}, the variant should be {string}, and the reason should be {string}" )
156
156
public void the_resolved_string_value_should_be_the_variant_should_be_and_the_reason_should_be (String expectedValue ,
157
- String expectedVariant , String expectedReason ) {
157
+ String expectedVariant , String expectedReason ) {
158
158
assertEquals (expectedValue , this .stringFlagDetails .getValue ());
159
159
assertEquals (expectedVariant , this .stringFlagDetails .getVariant ());
160
160
assertEquals (expectedReason , this .stringFlagDetails .getReason ());
@@ -168,7 +168,7 @@ public void an_integer_flag_with_key_is_evaluated_with_details_and_default_value
168
168
169
169
@ Then ("the resolved integer details value should be {int}, the variant should be {string}, and the reason should be {string}" )
170
170
public void the_resolved_integer_value_should_be_the_variant_should_be_and_the_reason_should_be (int expectedValue ,
171
- String expectedVariant , String expectedReason ) {
171
+ String expectedVariant , String expectedReason ) {
172
172
assertEquals (expectedValue , this .intFlagDetails .getValue ());
173
173
assertEquals (expectedVariant , this .intFlagDetails .getVariant ());
174
174
assertEquals (expectedReason , this .intFlagDetails .getReason ());
@@ -182,7 +182,7 @@ public void a_float_flag_with_key_is_evaluated_with_details_and_default_value(St
182
182
183
183
@ Then ("the resolved float details value should be {double}, the variant should be {string}, and the reason should be {string}" )
184
184
public void the_resolved_float_value_should_be_the_variant_should_be_and_the_reason_should_be (double expectedValue ,
185
- String expectedVariant , String expectedReason ) {
185
+ String expectedVariant , String expectedReason ) {
186
186
assertEquals (expectedValue , this .doubleFlagDetails .getValue ());
187
187
assertEquals (expectedVariant , this .doubleFlagDetails .getVariant ());
188
188
assertEquals (expectedReason , this .doubleFlagDetails .getReason ());
@@ -217,7 +217,7 @@ public void the_variant_should_be_and_the_reason_should_be(String expectedVarian
217
217
218
218
@ When ("context contains keys {string}, {string}, {string}, {string} with values {string}, {string}, {int}, {string}" )
219
219
public void context_contains_keys_with_values (String field1 , String field2 , String field3 , String field4 ,
220
- String value1 , String value2 , Integer value3 , String value4 ) {
220
+ String value1 , String value2 , Integer value3 , String value4 ) {
221
221
Map <String , Value > attributes = new HashMap <>();
222
222
attributes .put (field1 , new Value (value1 ));
223
223
attributes .put (field2 , new Value (value2 ));
@@ -253,7 +253,7 @@ public void the_resolved_flag_value_is_when_the_context_is_empty(String expected
253
253
// not found
254
254
@ When ("a non-existent string flag with key {string} is evaluated with details and a default value {string}" )
255
255
public void a_non_existent_string_flag_with_key_is_evaluated_with_details_and_a_default_value (String flagKey ,
256
- String defaultValue ) {
256
+ String defaultValue ) {
257
257
notFoundFlagKey = flagKey ;
258
258
notFoundDefaultValue = defaultValue ;
259
259
notFoundDetails = client .getStringDetails (notFoundFlagKey , notFoundDefaultValue );
@@ -273,7 +273,7 @@ public void the_reason_should_indicate_an_error_and_the_error_code_should_be_fla
273
273
// type mismatch
274
274
@ When ("a string flag with key {string} is evaluated as an integer, with details and a default value {int}" )
275
275
public void a_string_flag_with_key_is_evaluated_as_an_integer_with_details_and_a_default_value (String flagKey ,
276
- int defaultValue ) {
276
+ int defaultValue ) {
277
277
typeErrorFlagKey = flagKey ;
278
278
typeErrorDefaultValue = defaultValue ;
279
279
typeErrorDetails = client .getIntegerDetails (typeErrorFlagKey , typeErrorDefaultValue );
0 commit comments