From 48cd5f47424a063dc57868bd5d69f054ba3d06e3 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Fri, 18 Oct 2024 07:12:29 -0400 Subject: [PATCH] chore: blocking set-provider in tests Signed-off-by: Todd Baert --- src/test/java/dev/openfeature/sdk/OpenFeatureClientTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/dev/openfeature/sdk/OpenFeatureClientTest.java b/src/test/java/dev/openfeature/sdk/OpenFeatureClientTest.java index 82199accf..588396b58 100644 --- a/src/test/java/dev/openfeature/sdk/OpenFeatureClientTest.java +++ b/src/test/java/dev/openfeature/sdk/OpenFeatureClientTest.java @@ -42,7 +42,7 @@ void reset_logs() { @DisplayName("should not throw exception if hook has different type argument than hookContext") void shouldNotThrowExceptionIfHookHasDifferentTypeArgumentThanHookContext() { OpenFeatureAPI api = OpenFeatureAPI.getInstance(); - api.setProvider("shouldNotThrowExceptionIfHookHasDifferentTypeArgumentThanHookContext", new DoSomethingProvider()); + api.setProviderAndWait("shouldNotThrowExceptionIfHookHasDifferentTypeArgumentThanHookContext", new DoSomethingProvider()); Client client = api.getClient("shouldNotThrowExceptionIfHookHasDifferentTypeArgumentThanHookContext"); client.addHooks(mockBooleanHook(), mockStringHook()); FlagEvaluationDetails actual = client.getBooleanDetails("feature key", Boolean.FALSE); @@ -96,7 +96,7 @@ void shouldNotCallEvaluationMethodsWhenProviderIsInFatalErrorState() { void shouldNotCallEvaluationMethodsWhenProviderIsInNotReadyState() { FeatureProvider provider = new TestEventsProvider(5000); OpenFeatureAPI api = OpenFeatureAPI.getInstance(); - api.setProvider("shouldNotCallEvaluationMethodsWhenProviderIsInNotReadyState", provider); + api.setProviderAndWait("shouldNotCallEvaluationMethodsWhenProviderIsInNotReadyState", provider); Client client = api.getClient("shouldNotCallEvaluationMethodsWhenProviderIsInNotReadyState"); FlagEvaluationDetails details = client.getBooleanDetails("key", true);