Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ef5ad6e
MOB-23669 : Removing return statements while parsing callback event i…
sagar-sharma-adobe Jul 10, 2025
0aab88b
Merge pull request #191 from adobe/main
siddique-adobe Jul 10, 2025
378ef94
MOB-23669 : Adding test case for propositions with error case
sagar-sharma-adobe Jul 10, 2025
34ec511
MOB-23669 : renaming test case
sagar-sharma-adobe Jul 14, 2025
aed21d1
Merge pull request #192 from sagar-sharma-adobe/dev-v3.6.0
sagar-sharma-adobe Jul 14, 2025
f57caf8
enabling the gradle task to generate verification.properties file for…
siddique-adobe Jul 16, 2025
3b372c7
Merge pull request #193 from siddique-adobe/MOB-23615
siddique-adobe Jul 16, 2025
24e907d
Updating version to 3.6.1
github-actions[bot] Jul 16, 2025
6f0a9e3
Merge pull request #194 from adobe/update-version-3.6.1
siddique-adobe Jul 16, 2025
aee5e1e
Merge pull request #195 from adobe/dev-v3.6.1
siddique-adobe Jul 16, 2025
97b900c
Updating release and snapshot workflows for sonatype migration
siddique-adobe Jul 16, 2025
0892345
Merge pull request #196 from siddique-adobe/sonatype_migration
siddique-adobe Jul 17, 2025
56514e4
Merge pull request #197 from adobe/dev-v3.6.1
siddique-adobe Jul 17, 2025
1e2d575
1. Disabling Play Console Verification
siddique-adobe Jul 23, 2025
bf87cf0
Upgrading the core and edge SDK version
siddique-adobe Jul 24, 2025
69563b4
Setting enablePlayConsoleVerification to false
siddique-adobe Jul 24, 2025
a81d47d
Merge pull request #198 from siddique-adobe/MOB-23615
siddique-adobe Jul 24, 2025
5707dcb
Merge pull request #199 from adobe/dev-v3.6.1
siddique-adobe Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
publish:
permissions:
contents: write
uses: adobe/aepsdk-commons/.github/workflows/android-maven-release.yml@gha-android-3.3.0
uses: adobe/aepsdk-commons/.github/workflows/android-maven-release.yml@gha-android-3.4.2
with:
tag: ${{ github.event.inputs.tag }}
create-github-release: ${{ github.event.inputs.create-github-release == 'true' }}
version-validation-paths: code/gradle.properties, code/optimize/src/main/java/com/adobe/marketing/mobile/optimize/OptimizeConstants.java
version-validation-dependencies: Core ${{ github.event.inputs.core-dependency }}, Edge ${{ github.event.inputs.edge-dependency }}
staging-dir: code/optimize/build/staging-deploy
secrets: inherit
12 changes: 10 additions & 2 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ name: Publish Snapshot

on:
workflow_dispatch:
inputs:
ref:
description: "Git reference (branch, tag, or SHA) to check out when publishing the snapshot. Defaults to 'main'."
required: false
default: "staging"

jobs:
publish:
permissions:
contents: write
uses: adobe/aepsdk-commons/.github/workflows/android-maven-snapshot.yml@gha-android-3.3.0
secrets: inherit
uses: adobe/aepsdk-commons/.github/workflows/android-maven-snapshot.yml@gha-android-3.4.2
secrets: inherit
with:
ref: ${{ inputs.ref }}
staging-dir: code/optimize/build/staging-deploy
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ci-publish-maven-local-jitpack: assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication)

ci-publish-staging: assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToSonatypeRepository)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publish --stacktrace)

ci-publish: assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToSonatypeRepository -Prelease)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publish -Prelease)
2 changes: 1 addition & 1 deletion code/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ buildscript {
mavenLocal()
}
dependencies {
classpath("com.github.adobe:aepsdk-commons:gp-3.0.2")
classpath("com.github.adobe:aepsdk-commons:gp-3.4.1")
}
}
6 changes: 3 additions & 3 deletions code/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ org.gradle.caching=true
android.useAndroidX=true

moduleName=optimize
moduleVersion=3.6.0
moduleVersion=3.6.1

#Maven artifact
mavenRepoName=AdobeMobileOptimizeSdk
mavenRepoDescription=Adobe Experience Platform Optimize extension for the Adobe Experience Platform Mobile SDK
mavenUploadDryRunFlag=false

# production versions for production build
mavenCoreVersion=3.3.0
mavenEdgeVersion=3.0.1
mavenCoreVersion=3.5.0
mavenEdgeVersion=3.0.2
functionalTestEdgeVersion=3.0.1
1 change: 1 addition & 0 deletions code/optimize/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ aepLibrary {
enableDokkaDoc = true
enableSpotless = true
enableCheckStyle = true
enablePlayConsoleVerification = false

publishing {
gitRepoName = "aepsdk-optimize-android"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class OptimizeTestConstants {

static final String EXTENSION_VERSION = "3.6.0";
static final String EXTENSION_VERSION = "3.6.1";
public static final String LOG_TAG = "OptimizeTest";
static final String CONFIG_DATA_STORE = "AdobeMobile_ConfigState";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ public void call(final Event event) {
AEPOptimizeError.Companion.getUnexpectedError();
failWithOptimizeError(callback, aepOptimizeError);
}
return;
}

if (!eventData.containsKey(
OptimizeConstants.EventDataKeys.PROPOSITIONS)) {
AEPOptimizeError aepOptimizeError =
AEPOptimizeError.Companion.getUnexpectedError();
failWithOptimizeError(callback, aepOptimizeError);
return;
}

final List<Map<String, Object>> propositionsList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class OptimizeConstants {
static final String LOG_TAG = "Optimize";
static final String EXTENSION_VERSION = "3.6.0";
static final String EXTENSION_VERSION = "3.6.1";
static final String EXTENSION_NAME = "com.adobe.optimize";
static final String FRIENDLY_NAME = "Optimize";
static final double GET_RESPONSE_CALLBACK_TIMEOUT = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
public class OptimizeTests {
private Map<DecisionScope, OptimizeProposition> responseMap;
private AdobeError responseError;
private AEPOptimizeError optimizeError;

@After
public void teardown() {
responseMap = null;
responseError = null;
optimizeError = null;
}

@Test
Expand Down Expand Up @@ -222,6 +224,111 @@ public void call(Map<DecisionScope, OptimizeProposition> propositionsMap) {
}
}

@Test
public void testUpdatePropositionsWithCallback_SuccessWithError() throws Exception {
try (MockedStatic<MobileCore> mobileCoreMockedStatic =
Mockito.mockStatic(MobileCore.class);
MockedStatic<Base64> base64MockedStatic = Mockito.mockStatic(Base64.class)) {
// setup
base64MockedStatic
.when(
() ->
Base64.decode(
ArgumentMatchers.anyString(),
ArgumentMatchers.anyInt()))
.thenAnswer(
(Answer<byte[]>)
invocation ->
java.util.Base64.getDecoder()
.decode((String) invocation.getArguments()[0]));

// test
final List<DecisionScope> scopes = new ArrayList<>();
scopes.add(
new DecisionScope(
"eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ=="));

Optimize.updatePropositions(
scopes,
null,
null,
new AdobeCallbackWithOptimizeError<Map<DecisionScope, OptimizeProposition>>() {
@Override
public void fail(AEPOptimizeError adobeError) {
optimizeError = adobeError;
}

@Override
public void call(Map<DecisionScope, OptimizeProposition> propositionsMap) {
responseMap = propositionsMap;
}
});

final ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
final ArgumentCaptor<AdobeCallbackWithError<Event>> callbackCaptor =
ArgumentCaptor.forClass(AdobeCallbackWithError.class);

mobileCoreMockedStatic.verify(
() ->
MobileCore.dispatchEventWithResponseCallback(
eventCaptor.capture(),
ArgumentMatchers.anyLong(),
callbackCaptor.capture()));

final Event event = eventCaptor.getValue();
final AdobeCallbackWithError<Event> callbackWithError = callbackCaptor.getValue();

Assert.assertNotNull(event);
Assert.assertEquals("com.adobe.eventType.optimize", event.getType());
Assert.assertEquals("com.adobe.eventSource.requestContent", event.getSource());

final Map<String, Object> eventData = event.getEventData();
Assert.assertEquals("updatepropositions", eventData.get("requesttype"));

final List<Map<String, Object>> scopesList =
(List<Map<String, Object>>) eventData.get("decisionscopes");
Assert.assertEquals(1, scopesList.size());

final Map<String, Object> scopeData = scopesList.get(0);
Assert.assertNotNull(scopeData);
Assert.assertEquals(1, scopeData.size());
Assert.assertEquals(
"eyJhY3Rpdml0eUlkIjoieGNvcmU6b2ZmZXItYWN0aXZpdHk6MTExMTExMTExMTExMTExMSIsInBsYWNlbWVudElkIjoieGNvcmU6b2ZmZXItcGxhY2VtZW50OjExMTExMTExMTExMTExMTEifQ==",
scopeData.get("name"));

// verify callback response
final Map<String, Object> propositionData =
new ObjectMapper()
.readValue(
getClass()
.getClassLoader()
.getResource("json/PROPOSITION_VALID_ODE.json"),
HashMap.class);
final OptimizeProposition optimizeProposition =
OptimizeProposition.fromEventData(propositionData);
Assert.assertNotNull(optimizeProposition);

final List<Map<String, Object>> propositionsList = new ArrayList<>();
propositionsList.add(optimizeProposition.toEventData());

final Map<String, Object> responseEventData = new HashMap<>();
responseEventData.put("propositions", propositionsList);
responseEventData.put(
"responseerror", AEPOptimizeError.Companion.getUnexpectedError().toEventData());
final Event responseEvent =
new Event.Builder(
"Optimize Response",
"com.adobe.eventType.optimize",
"com.adobe.eventSource.responseContent")
.setEventData(responseEventData)
.build();
callbackWithError.call(responseEvent);

Assert.assertNotNull(optimizeError);
Assert.assertNotNull(responseMap);
}
}

@Test
public void testUpdatePropositions_validDecisionScopeWithXDMAndData() {
try (MockedStatic<MobileCore> mobileCoreMockedStatic =
Expand Down
2 changes: 1 addition & 1 deletion code/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencyResolutionManagement {
google()
mavenCentral()
mavenLocal()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots/") }
maven { url = uri("https://jitpack.io") }
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/testapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ android {

dependencies {
implementation(project(":optimize"))
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.8.0"))
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.13.0"))
implementation("com.adobe.marketing.mobile:edge")
implementation("com.adobe.marketing.mobile:core")
implementation("com.adobe.marketing.mobile:edgeidentity")
Expand Down
Loading