From 8715f34938bd668be9784b9d3d4db90253b69369 Mon Sep 17 00:00:00 2001 From: saquib-adobe Date: Mon, 27 Jan 2025 15:45:08 +0530 Subject: [PATCH] 1. Removed the deprecated overridden updatePropositions from public interface 2. Moved the existing tests calls to update and get propositions internal methods 3. Changed signature of of get and update propositions internal from private to package-private and made Visible for testing --- .../optimize/OptimizeFunctionalTests.java | 163 +++++++++++++----- .../marketing/mobile/optimize/Optimize.java | 33 +--- .../mobile/optimize/OptimizeTests.java | 39 +++-- 3 files changed, 149 insertions(+), 86 deletions(-) diff --git a/code/optimize/src/androidTest/java/com/adobe/marketing/mobile/optimize/OptimizeFunctionalTests.java b/code/optimize/src/androidTest/java/com/adobe/marketing/mobile/optimize/OptimizeFunctionalTests.java index 063d401f..1c4709a6 100644 --- a/code/optimize/src/androidTest/java/com/adobe/marketing/mobile/optimize/OptimizeFunctionalTests.java +++ b/code/optimize/src/androidTest/java/com/adobe/marketing/mobile/optimize/OptimizeFunctionalTests.java @@ -87,10 +87,11 @@ public void testUpdatePropositions_timeoutError() throws Exception { updateConfiguration(configData); // Action - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( Collections.singletonList(new DecisionScope(decisionScopeName)), null, null, + 10.0, new AdobeCallbackWithOptimizeError>() { @Override public void fail(AEPOptimizeError error) { @@ -122,8 +123,12 @@ public void testUpdatePropositions_validDecisionScope() throws InterruptedExcept updateConfiguration(configData); // Action - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeName)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeName)), + null, + null, + 10.0, + null); // Assert List eventsListOptimize = @@ -182,8 +187,12 @@ public void testUpdatePropositions_validNonEncodedDecisionScope() throws Interru updateConfiguration(configData); // Action - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(activityId, placementId)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(activityId, placementId)), + null, + null, + 10.0, + null); // Assert List eventsListOptimize = @@ -248,9 +257,11 @@ public void testUpdatePropositions_validNonEncodedDecisionScopeWithItemCount() updateConfiguration(configData); // Action - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( Collections.singletonList(new DecisionScope(activityId, placementId, itemCount)), null, + null, + 10.0, null); // Assert @@ -329,8 +340,12 @@ public void testUpdatePropositions_validDecisionScopeWithXdmAndDataAndDatasetId( configData.put("optimize.datasetId", optimizeDatasetId); updateConfiguration(configData); - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeName)), xdmMap, dataMap); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeName)), + xdmMap, + dataMap, + 10.0, + null); // Assert List eventsListOptimize = @@ -398,11 +413,13 @@ public void testUpdatePropositions_multipleValidDecisionScope() throws Interrupt updateConfiguration(configData); // Action - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( Arrays.asList( new DecisionScope(decisionScopeName1), new DecisionScope(decisionScopeName2)), null, + null, + 10.0, null); // Assert @@ -461,8 +478,12 @@ public void testUpdatePropositions_ConfigNotAvailable() throws InterruptedExcept clearUpdatedConfiguration(); // Action - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeName)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeName)), + null, + null, + 10.0, + null); // Assert List eventsListOptimize = @@ -493,11 +514,13 @@ public void testUpdatePropositions_validAndInvalidDecisionScopes() throws Interr updateConfiguration(configData); // Action - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( Arrays.asList( new DecisionScope(decisionScopeName1), new DecisionScope(decisionScopeName2)), null, + null, + 10.0, null); // Assert @@ -556,8 +579,12 @@ public void testGetPropositions_decisionScopeInCache() final String decisionScopeString = "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -661,8 +688,9 @@ public void testGetPropositions_decisionScopeInCache() DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -717,8 +745,12 @@ public void testGetPropositions_defaultContentItem() throws InterruptedException updateConfiguration(configData); final String decisionScopeString = "someDecisionScope"; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -830,8 +862,9 @@ public void testGetPropositions_defaultContentItem() throws InterruptedException DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -886,8 +919,12 @@ public void testGetPropositions_decisionScopeInCacheFromTargetResponseWithClickT updateConfiguration(configData); final String decisionScopeString = "myMbox1"; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -1020,8 +1057,9 @@ public void testGetPropositions_decisionScopeInCacheFromTargetResponseWithClickT final DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1119,8 +1157,12 @@ public void testGetPropositions_notAllDecisionScopesInCache() final String decisionScopeString = "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -1222,8 +1264,9 @@ public void testGetPropositions_notAllDecisionScopesInCache() DecisionScope decisionScope2 = new DecisionScope("myMbox"); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Arrays.asList(decisionScope1, decisionScope2), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1360,8 +1403,9 @@ public void testGetPropositions_noDecisionScopeInCache() DecisionScope decisionScope2 = new DecisionScope("myMbox2"); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Arrays.asList(decisionScope1, decisionScope2), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1412,8 +1456,9 @@ public void testGetPropositions_emptyCache() throws InterruptedException { final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); final Map propositionMap = new HashMap<>(); TestHelper.resetTestExpectations(); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Arrays.asList(decisionScope1, decisionScope2), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1707,8 +1752,12 @@ public void testClearCachedPropositions() throws InterruptedException, IOExcepti final String decisionScopeString = "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -1811,8 +1860,9 @@ public void testClearCachedPropositions() throws InterruptedException, IOExcepti DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1838,8 +1888,9 @@ public void call( final ADBCountDownLatch countDownLatch1 = new ADBCountDownLatch(1); propositionMap.clear(); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -1868,8 +1919,12 @@ public void testCoreResetIdentities() throws InterruptedException, IOException { final String decisionScopeString = "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="; - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -1972,8 +2027,9 @@ public void testCoreResetIdentities() throws InterruptedException, IOException { DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); final ADBCountDownLatch countDownLatch = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -2001,8 +2057,9 @@ public void call( TestHelper.resetTestExpectations(); propositionMap.clear(); final ADBCountDownLatch countDownLatch1 = new ADBCountDownLatch(1); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -2246,8 +2303,12 @@ public void testGetPropositions_multipleUpdatePropositonsCallsBeforeGetPropositi "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="; // Setting up the cache with a decision scope and a proposition. - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -2345,8 +2406,12 @@ public void testGetPropositions_multipleUpdatePropositonsCallsBeforeGetPropositi TestHelper.resetTestExpectations(); // Firing another update event with same decision scope but different proposition data. - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeString)), + null, + null, + 10.0, + null); List secondEventsListEdge = TestHelper.getDispatchedEventsWith( @@ -2432,8 +2497,9 @@ public void testGetPropositions_multipleUpdatePropositonsCallsBeforeGetPropositi DecisionScope decisionScope = new DecisionScope(decisionScopeString); final Map propositionMap = new HashMap<>(); - Optimize.getPropositions( + Optimize.getPropositionsInternal( Collections.singletonList(decisionScope), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -2492,8 +2558,12 @@ public void testGetPropositions_FewDecisionScopesNotInCacheAndGetToBeQueued() "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3Rpdml0eUlkIjoic2NvcGUtYiIsInBsYWNlbWVudElkIjoic2NvcGUtYl9wbGFjZW1lbnQifQ.QzNxT1dBZ1Z1M0Z5dW84SjdKak1nY2c1"; // Setting up the cache with decisionScopeA and a proposition. - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeAString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeAString)), + null, + null, + 10.0, + null); List eventsListEdge = TestHelper.getDispatchedEventsWith( OptimizeTestConstants.EventType.EDGE, @@ -2554,8 +2624,12 @@ public void testGetPropositions_FewDecisionScopesNotInCacheAndGetToBeQueued() TestHelper.resetTestExpectations(); // Update event with decisionScopeB - Optimize.updatePropositions( - Collections.singletonList(new DecisionScope(decisionScopeBString)), null, null); + Optimize.updatePropositionsInternal( + Collections.singletonList(new DecisionScope(decisionScopeBString)), + null, + null, + 10.0, + null); List secondEventsListEdge = TestHelper.getDispatchedEventsWith( @@ -2598,10 +2672,11 @@ public void testGetPropositions_FewDecisionScopesNotInCacheAndGetToBeQueued() Thread.sleep(1000); // Execute get proposition event with both decisionScopeA and decisionScopeB - Optimize.getPropositions( + Optimize.getPropositionsInternal( Arrays.asList( new DecisionScope(decisionScopeAString), new DecisionScope(decisionScopeBString)), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { diff --git a/code/optimize/src/main/java/com/adobe/marketing/mobile/optimize/Optimize.java b/code/optimize/src/main/java/com/adobe/marketing/mobile/optimize/Optimize.java index b97c326c..d5576a4d 100644 --- a/code/optimize/src/main/java/com/adobe/marketing/mobile/optimize/Optimize.java +++ b/code/optimize/src/main/java/com/adobe/marketing/mobile/optimize/Optimize.java @@ -13,6 +13,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; import com.adobe.marketing.mobile.AdobeCallback; import com.adobe.marketing.mobile.AdobeCallbackWithError; import com.adobe.marketing.mobile.AdobeError; @@ -43,30 +44,6 @@ private Optimize() {} return OptimizeConstants.EXTENSION_VERSION; } - /** - * This API dispatches an Event for the Edge network extension to fetch decision propositions, - * for the provided decision scopes list, from the decisioning services enabled in the - * Experience Edge network. - * - *

The returned decision propositions are cached in-memory in the Optimize SDK extension and - * can be retrieved using {@link #getPropositions(List, AdobeCallback)} API. - * - * @param decisionScopes {@code List} containing scopes for which offers need to - * be updated. - * @param xdm {@code Map} containing additional XDM-formatted data to be sent in - * the personalization query request. - * @param data {@code Map} containing additional free-form data to be sent in - * the personalization query request. - */ - @Deprecated - public static void updatePropositions( - @NonNull final List decisionScopes, - @Nullable final Map xdm, - @Nullable final Map data) { - - updatePropositions(decisionScopes, xdm, data, null); - } - /** * This API dispatches an Event for the Edge network extension to fetch decision propositions, * for the provided decision scopes list, from the decisioning services enabled in the @@ -122,7 +99,8 @@ public static void updatePropositions( updatePropositionsInternal(decisionScopes, xdm, data, timeoutSeconds, callback); } - private static void updatePropositionsInternal( + @VisibleForTesting + static void updatePropositionsInternal( @NonNull final List decisionScopes, @Nullable final Map xdm, @Nullable final Map data, @@ -300,7 +278,8 @@ public static void getPropositions( getPropositionsInternal(decisionScopes, timeoutSeconds, callback); } - private static void getPropositionsInternal( + @VisibleForTesting + static void getPropositionsInternal( @NonNull final List decisionScopes, final double timeoutSeconds, @NonNull final AdobeCallback> callback) { @@ -416,7 +395,7 @@ public void call(final Event event) { * query. * *

The personalization query requests can be triggered by the {@link - * Optimize#updatePropositions(List, Map, Map)} API, Edge extension {@code + * Optimize#updatePropositions(List, Map, Map, AdobeCallback)} API, Edge extension {@code * sendEvent(ExperienceEvent, EdgeCallback)} API or launch consequence rules. * * @param callback {@code AdobeCallbackWithError>} which diff --git a/code/optimize/src/test/java/com/adobe/marketing/mobile/optimize/OptimizeTests.java b/code/optimize/src/test/java/com/adobe/marketing/mobile/optimize/OptimizeTests.java index c26255c1..07cd37cc 100644 --- a/code/optimize/src/test/java/com/adobe/marketing/mobile/optimize/OptimizeTests.java +++ b/code/optimize/src/test/java/com/adobe/marketing/mobile/optimize/OptimizeTests.java @@ -82,7 +82,7 @@ public void testUpdatePropositions_validDecisionScope() { new DecisionScope( "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); - Optimize.updatePropositions(scopes, null, null); + Optimize.updatePropositionsInternal(scopes, null, null, 10.0, null); // verify @@ -144,10 +144,11 @@ public void testUpdatePropositionsWithCallback_validDecisionScope() throws Excep new DecisionScope( "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( scopes, null, null, + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -246,7 +247,7 @@ public void testUpdatePropositions_validDecisionScopeWithXDMAndData() { new DecisionScope( "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); - Optimize.updatePropositions( + Optimize.updatePropositionsInternal( scopes, new HashMap() { { @@ -257,7 +258,9 @@ public void testUpdatePropositions_validDecisionScopeWithXDMAndData() { { put("myKey", "myValue"); } - }); + }, + 10.0, + null); final ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(Event.class); final ArgumentCaptor> callbackCaptor = @@ -326,7 +329,7 @@ public void testUpdatePropositions_multipleValidDecisionScopes() { "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); scopes.add(new DecisionScope("myMbox")); - Optimize.updatePropositions(scopes, null, null); + Optimize.updatePropositionsInternal(scopes, null, null, 10.0, null); final ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(Event.class); final ArgumentCaptor> callbackCaptor = @@ -371,7 +374,8 @@ public void testUpdatePropositions_multipleValidDecisionScopes() { public void testUpdatePropositions_emptyDecisionScopesList() { try (MockedStatic logMockedStatic = Mockito.mockStatic(Log.class)) { // test - Optimize.updatePropositions(new ArrayList(), null, null); + Optimize.updatePropositionsInternal( + new ArrayList(), null, null, 10.0, null); // verify logMockedStatic.verify( @@ -387,7 +391,7 @@ public void testUpdatePropositions_emptyDecisionScopesList() { public void testUpdatePropositions_nullDecisionScopesList() { try (MockedStatic logMockedStatic = Mockito.mockStatic(Log.class)) { // test - Optimize.updatePropositions(null, null, null); + Optimize.updatePropositionsInternal(null, null, null, 10.0, null); // verify logMockedStatic.verify( @@ -421,7 +425,7 @@ public void testUpdatePropositions_invalidDecisionScopeInList() { new DecisionScope( "eyJhY3Rpdml0eUlkIjoiIiwicGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTExMTExMTExMTExMTExMSJ9")); - Optimize.updatePropositions(scopes, null, null); + Optimize.updatePropositionsInternal(scopes, null, null, 10.0, null); // verify logMockedStatic.verify( @@ -457,8 +461,9 @@ public void testGetPropositions_validDecisionScope() throws Exception { new DecisionScope( "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); - Optimize.getPropositions( + Optimize.getPropositionsInternal( scopes, + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -564,8 +569,9 @@ public void testGetPropositions_multipleValidDecisionScopes() { "eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==")); scopes.add(new DecisionScope("myMbox")); - Optimize.getPropositions( + Optimize.getPropositionsInternal( scopes, + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -634,8 +640,9 @@ public void testGetPropositions_invalidDecisionScopeInList() { new DecisionScope( "eyJhY3Rpdml0eUlkIjoiIiwicGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTExMTExMTExMTExMTExMSJ9")); - Optimize.getPropositions( + Optimize.getPropositionsInternal( scopes, + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -663,8 +670,9 @@ public void call(Map propositionsMap) { public void testGetPropositions_emptyDecisionScopesList() { try (MockedStatic logMockedStatic = Mockito.mockStatic(Log.class)) { // test - Optimize.getPropositions( + Optimize.getPropositionsInternal( new ArrayList(), + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -692,8 +700,9 @@ public void call(Map propositionsMap) { public void testGetPropositions_nullDecisionScopesList() { try (MockedStatic logMockedStatic = Mockito.mockStatic(Log.class)) { // test - Optimize.getPropositions( + Optimize.getPropositionsInternal( null, + 10.0, new AdobeCallbackWithError>() { @Override public void fail(AdobeError adobeError) { @@ -950,7 +959,7 @@ public void testUpdatePropositions_timeoutError() { return null; }); - Optimize.updatePropositions(scopes, xdm, data, timeoutSeconds, callbackMock); + Optimize.updatePropositionsInternal(scopes, xdm, data, timeoutSeconds, callbackMock); ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(AEPOptimizeError.class); verify(callbackMockEvent, times(1)).fail(errorCaptor.capture()); @@ -1007,7 +1016,7 @@ public void testGetPropositions_timeoutError() { return null; }); - Optimize.getPropositions(scopes, timeoutSeconds, callbackMock); + Optimize.getPropositionsInternal(scopes, timeoutSeconds, callbackMock); ArgumentCaptor errorCaptor = ArgumentCaptor.forClass(AEPOptimizeError.class); verify(callbackMockEvent, times(1)).fail(errorCaptor.capture());