From 16e9ed26427977dd570f1d0a8ec168b61f55963b Mon Sep 17 00:00:00 2001 From: Kevin Lind <40409666+kevinlind@users.noreply.github.com> Date: Wed, 31 Mar 2021 10:19:28 -0700 Subject: [PATCH] Update failing tests (#34) * Wait for test threads to finsh to allow direct Identity extension to register * In ECID handling tests, register both extensions after directly setting legacy ECID in persistence. --- .../edge/identity/IdentityECIDHandlingTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java index 648e454a..e2286031 100644 --- a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java +++ b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityECIDHandlingTest.java @@ -116,16 +116,14 @@ public void testECID_onResetClearsOldECID() throws Exception { @Test public void testECID_AreDifferentAfterPrivacyChange() throws Exception { /// Test Edge Identity and IdentityDirect have same ECID on bootup, and after privacy change ECIDs are different - registerIdentityDirectExtension(); - - // register EdgeIdentity extension - Identity.registerExtension(); + setIdentityDirectPersistedECID("legacyECID"); + registerBothIdentityExtensions(); TestHelper.waitForThreads(2000); // verify ECID for both extensions are same String directECID = getIdentityDirectECIDSync(); String edgeECID = getExperienceCloudIdSync(); - assertNotNull(edgeECID); + assertEquals("legacyECID", edgeECID); assertEquals(directECID, edgeECID); // Toggle privacy @@ -142,16 +140,14 @@ public void testECID_AreDifferentAfterResetIdentitiesAndPrivacyChange() throws E /// Test Edge Identity and IdentityDirect have same ECID on bootup, and after resetIdentities and privacy change ECIDs are different // 1) Register Identity then Edge Identity and verify both have same ECID - registerIdentityDirectExtension(); - - // register EdgeIdentity extension - Identity.registerExtension(); + setIdentityDirectPersistedECID("legacyECID"); + registerBothIdentityExtensions(); TestHelper.waitForThreads(2000); // verify ECID for both extensions are same String directECID = getIdentityDirectECIDSync(); String edgeECID = getExperienceCloudIdSync(); - assertNotNull(edgeECID); + assertEquals("legacyECID", edgeECID); assertEquals(directECID, edgeECID); // 2) Reset identities and toggle privacy and verify legacy ECID added to IdentityMap