6
6
import dev .openfeature .contrib .providers .flagd .FlagdProvider ;
7
7
import dev .openfeature .sdk .Client ;
8
8
import dev .openfeature .sdk .FlagEvaluationDetails ;
9
- import dev .openfeature .sdk .MutableStructure ;
10
9
import dev .openfeature .sdk .MutableContext ;
11
10
import dev .openfeature .sdk .OpenFeatureAPI ;
12
11
import dev .openfeature .sdk .Reason ;
13
12
import dev .openfeature .sdk .Structure ;
14
13
import dev .openfeature .sdk .Value ;
15
14
import io .cucumber .java .BeforeAll ;
15
+ import io .cucumber .java .en .Given ;
16
16
import io .cucumber .java .en .Then ;
17
17
import io .cucumber .java .en .When ;
18
18
@@ -44,7 +44,9 @@ public class StepDefinitions {
44
44
private FlagEvaluationDetails <Integer > typeErrorDetails ;
45
45
46
46
@ BeforeAll ()
47
+ @ Given ("an openfeature client is registered with cache disabled" )
47
48
public static void setup () {
49
+ // TODO: when the FlagdProvider is updated to support caching, we might need to disable it here for this test to work as expected.
48
50
FlagdProvider provider = new FlagdProvider ();
49
51
provider .setDeadline (3000 ); // set a generous deadline, to prevent timeouts in actions
50
52
OpenFeatureAPI .getInstance ().setProvider (provider );
@@ -249,7 +251,7 @@ public void a_non_existent_string_flag_with_key_is_evaluated_with_details_and_a_
249
251
notFoundDetails = client .getStringDetails (notFoundFlagKey , notFoundDefaultValue );
250
252
}
251
253
252
- @ Then ("then the default string value should be returned" )
254
+ @ Then ("the default string value should be returned" )
253
255
public void then_the_default_string_value_should_be_returned () {
254
256
assertEquals (notFoundDefaultValue , notFoundDetails .getValue ());
255
257
}
@@ -270,7 +272,7 @@ public void a_string_flag_with_key_is_evaluated_as_an_integer_with_details_and_a
270
272
typeErrorDetails = client .getIntegerDetails (typeErrorFlagKey , typeErrorDefaultValue );
271
273
}
272
274
273
- @ Then ("then the default integer value should be returned" )
275
+ @ Then ("the default integer value should be returned" )
274
276
public void then_the_default_integer_value_should_be_returned () {
275
277
assertEquals (typeErrorDefaultValue , typeErrorDetails .getValue ());
276
278
}
0 commit comments