Skip to content

Commit

Permalink
Update failing tests (#34)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
kevinlind authored Mar 31, 2021
1 parent be5e5b5 commit 16e9ed2
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 16e9ed2

Please sign in to comment.