diff --git a/GrowthBook/src/commonMain/kotlin/com/sdk/growthbook/GBSDKBuilder.kt b/GrowthBook/src/commonMain/kotlin/com/sdk/growthbook/GBSDKBuilder.kt index ea564b0..23abde7 100644 --- a/GrowthBook/src/commonMain/kotlin/com/sdk/growthbook/GBSDKBuilder.kt +++ b/GrowthBook/src/commonMain/kotlin/com/sdk/growthbook/GBSDKBuilder.kt @@ -63,7 +63,7 @@ abstract class SDKBuilder( * This method is open to be overridden by subclasses */ abstract suspend fun initialize(): GrowthBookSDK - abstract fun initializeWithoutCall(): GrowthBookSDK + abstract fun initializeWithoutWaitForCall(): GrowthBookSDK } /** @@ -158,7 +158,7 @@ class GBSDKBuilder( * Initialize the Kotlin SDK * This init method takes less time than suspend version */ - override fun initializeWithoutCall(): GrowthBookSDK { + override fun initializeWithoutWaitForCall(): GrowthBookSDK { val gbContext = createGbContext() if (enableLogging && !cachingEnabled) { diff --git a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/integration/IntegrationTestTools.kt b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/integration/IntegrationTestTools.kt index 3cdf2cb..e4408fb 100644 --- a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/integration/IntegrationTestTools.kt +++ b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/integration/IntegrationTestTools.kt @@ -23,5 +23,5 @@ internal fun buildSDK( encryptionKey = "", trackingCallback = trackingCallback, networkDispatcher = networkDispatcher, - ).initializeWithoutCall() + ).initializeWithoutWaitForCall() } diff --git a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBEncryptedFeatures.kt b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBEncryptedFeatures.kt index 46c3a22..3aced39 100644 --- a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBEncryptedFeatures.kt +++ b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBEncryptedFeatures.kt @@ -57,7 +57,7 @@ class GBEncryptedFeatures { encryptionKey = "", trackingCallback = { _, _ -> }, networkDispatcher = MockNetworkClient(null, null), - ).initializeWithoutCall() + ).initializeWithoutWaitForCall() val keyString = "Ns04T5n9+59rl2x3SlNHtQ==" val encryptedFeatures = diff --git a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBFeatureValueTests.kt b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBFeatureValueTests.kt index 835f9f8..fbac680 100644 --- a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBFeatureValueTests.kt +++ b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GBFeatureValueTests.kt @@ -146,7 +146,7 @@ class GBFeatureValueTests { actualNumberOfOnFeatureUsageCalls++ } - val sdk: GrowthBookSDK = builder.initializeWithoutCall() + val sdk: GrowthBookSDK = builder.initializeWithoutWaitForCall() for (item in evalConditions) { if (item is JsonArray) { diff --git a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GrowthBookSDKBuilderTests.kt b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GrowthBookSDKBuilderTests.kt index bc3f6de..81b2825 100644 --- a/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GrowthBookSDKBuilderTests.kt +++ b/GrowthBook/src/jvmTest/kotlin/com/sdk/growthbook/tests/GrowthBookSDKBuilderTests.kt @@ -41,7 +41,7 @@ class GrowthBookSDKBuilderTests { trackingCallback = { _: GBExperiment, _: GBExperimentResult? -> }, networkDispatcher = MockNetworkClient(null, null), remoteEval = false - ).initializeWithoutCall() + ).initializeWithoutWaitForCall() assertEquals(sdkInstance.getGBContext().apiKey, testApiKey) assertTrue(sdkInstance.getGBContext().enabled) @@ -64,7 +64,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(null, null), remoteEval = false ).setRefreshHandler { isRefreshed, gbError -> - }.setEnabled(false).setForcedVariations(variations).setQAMode(true).initializeWithoutCall() + }.setEnabled(false).setForcedVariations(variations).setQAMode(true).initializeWithoutWaitForCall() assertTrue(sdkInstance.getGBContext().apiKey == testApiKey) assertFalse(sdkInstance.getGBContext().enabled) @@ -90,7 +90,7 @@ class GrowthBookSDKBuilderTests { ).setRefreshHandler { isRefreshed, gbError -> } - .setEnabled(false).setForcedVariations(variations).setQAMode(true).initializeWithoutCall() + .setEnabled(false).setForcedVariations(variations).setQAMode(true).initializeWithoutWaitForCall() assertTrue(sdkInstance.getGBContext().apiKey == testApiKey) assertFalse(sdkInstance.getGBContext().enabled) @@ -114,7 +114,7 @@ class GrowthBookSDKBuilderTests { remoteEval = false ).setRefreshHandler { _, gbError -> isRefreshed = true - }.initializeWithoutCall() + }.initializeWithoutWaitForCall() assertTrue(isRefreshed) @@ -142,7 +142,7 @@ class GrowthBookSDKBuilderTests { remoteEval = false ).setRefreshHandler { _, gbError -> isRefreshed = true - }.initializeWithoutCall() + }.initializeWithoutWaitForCall() assertTrue(isRefreshed) @@ -162,7 +162,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = false ).setRefreshHandler { isRefreshed, gbError -> - }.initializeWithoutCall() + }.initializeWithoutWaitForCall() val featureValue = sdkInstance.feature("fwrfewrfe") assertEquals(featureValue.source, GBFeatureSource.unknownFeature) @@ -198,7 +198,7 @@ class GrowthBookSDKBuilderTests { remoteEval = false ).setPrefixForStickyBucketCachedDirectory( prefix = "test_prefix" - ).initializeWithoutCall() + ).initializeWithoutWaitForCall() assertTrue { sdkInstance.getGBContext().stickyBucketService != null } assertTrue { sdkInstance.getGBContext().stickyBucketService is GBStickyBucketServiceImp } @@ -215,7 +215,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = false ).setStickyBucketService() - .initializeWithoutCall() + .initializeWithoutWaitForCall() assertTrue { sdkInstance.getGBContext().stickyBucketService != null } assertTrue { sdkInstance.getGBContext().stickyBucketService is GBStickyBucketServiceImp } @@ -233,7 +233,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = false ).setForcedVariations(expectedForcedVariation) - .initializeWithoutCall() + .initializeWithoutWaitForCall() val actualForcedVariation = sdkInstance.getGBContext().forcedVariations @@ -253,7 +253,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = true ).setForcedVariations(expectedForcedVariation) - .initializeWithoutCall() + .initializeWithoutWaitForCall() sdkInstance.forcedFeatures = mapOf("featureForce" to GBNumber(112)) val actualForcedVariation = sdkInstance.getGBContext().forcedVariations @@ -275,7 +275,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = false ) - .initializeWithoutCall() + .initializeWithoutWaitForCall() sdkInstance.setAttributeOverrides(expectedAttributes) @@ -297,7 +297,7 @@ class GrowthBookSDKBuilderTests { networkDispatcher = MockNetworkClient(MockResponse.successResponse, null), remoteEval = true ).setStickyBucketService(GBStickyBucketServiceImp()) - .initializeWithoutCall() + .initializeWithoutWaitForCall() sdkInstance.setAttributeOverrides(expectedAttributes) @@ -321,7 +321,7 @@ class GrowthBookSDKBuilderTests { trackingCallback = { _, _ -> }, networkDispatcher = MockNetworkClient(json, null), remoteEval = false - ).initializeWithoutCall() + ).initializeWithoutWaitForCall() } // @Test