Skip to content

Commit f8ac46f

Browse files
authored
chore: update cuke submodule, tests (#231)
* chore: update cuke submodule, tests Signed-off-by: Todd Baert <[email protected]> * fixup: add note about flagd caching Signed-off-by: Todd Baert <[email protected]> Signed-off-by: Todd Baert <[email protected]>
1 parent 5e53fbf commit f8ac46f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@
519519
<goal>exec</goal>
520520
</goals>
521521
<configuration>
522+
<!-- copy the feature spec we want to test into resources so them can be easily loaded -->
522523
<!-- run: cp test-harness/features/evaluation.feature src/test/resources/features/ -->
523524
<executable>cp</executable>
524525
<arguments>

src/test/java/dev/openfeature/sdk/integration/StepDefinitions.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import dev.openfeature.contrib.providers.flagd.FlagdProvider;
77
import dev.openfeature.sdk.Client;
88
import dev.openfeature.sdk.FlagEvaluationDetails;
9-
import dev.openfeature.sdk.MutableStructure;
109
import dev.openfeature.sdk.MutableContext;
1110
import dev.openfeature.sdk.OpenFeatureAPI;
1211
import dev.openfeature.sdk.Reason;
1312
import dev.openfeature.sdk.Structure;
1413
import dev.openfeature.sdk.Value;
1514
import io.cucumber.java.BeforeAll;
15+
import io.cucumber.java.en.Given;
1616
import io.cucumber.java.en.Then;
1717
import io.cucumber.java.en.When;
1818

@@ -44,7 +44,9 @@ public class StepDefinitions {
4444
private FlagEvaluationDetails<Integer> typeErrorDetails;
4545

4646
@BeforeAll()
47+
@Given("an openfeature client is registered with cache disabled")
4748
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.
4850
FlagdProvider provider = new FlagdProvider();
4951
provider.setDeadline(3000); // set a generous deadline, to prevent timeouts in actions
5052
OpenFeatureAPI.getInstance().setProvider(provider);
@@ -249,7 +251,7 @@ public void a_non_existent_string_flag_with_key_is_evaluated_with_details_and_a_
249251
notFoundDetails = client.getStringDetails(notFoundFlagKey, notFoundDefaultValue);
250252
}
251253

252-
@Then("then the default string value should be returned")
254+
@Then("the default string value should be returned")
253255
public void then_the_default_string_value_should_be_returned() {
254256
assertEquals(notFoundDefaultValue, notFoundDetails.getValue());
255257
}
@@ -270,7 +272,7 @@ public void a_string_flag_with_key_is_evaluated_as_an_integer_with_details_and_a
270272
typeErrorDetails = client.getIntegerDetails(typeErrorFlagKey, typeErrorDefaultValue);
271273
}
272274

273-
@Then("then the default integer value should be returned")
275+
@Then("the default integer value should be returned")
274276
public void then_the_default_integer_value_should_be_returned() {
275277
assertEquals(typeErrorDefaultValue, typeErrorDetails.getValue());
276278
}

test-harness

0 commit comments

Comments
 (0)