Skip to content

Commit 4131d98

Browse files
committed
Removed syncHashedEmail tests
1 parent e663a2d commit 4131d98

File tree

1 file changed

+2
-48
lines changed

1 file changed

+2
-48
lines changed

OneSignalSDK/unittest/src/test/java/com/test/onesignal/MainOneSignalClassRunner.java

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,6 @@ public void testOneSignalMethodsBeforeInit() throws Exception {
21522152

21532153
//queue up a bunch of actions and check that the queue gains size before init
21542154
// ----- START QUEUE ------
2155-
OneSignal.syncHashedEmail("test@test.com");
21562155

21572156
for(int a = 0; a < 500; a++) {
21582157
OneSignal.sendTag("a" + a, String.valueOf(a));
@@ -2176,8 +2175,8 @@ public void tagsAvailable(JSONObject tags) {
21762175

21772176
// ----- END QUEUE ------
21782177

2179-
// There should be 502 pending operations in the queue
2180-
assertEquals(502, OneSignal_taskQueueWaitingForInit().size());
2178+
// There should be 501 pending operations in the queue
2179+
assertEquals(501, OneSignal_taskQueueWaitingForInit().size());
21812180

21822181
OneSignalInit(); //starts the pending tasks executor
21832182

@@ -2188,7 +2187,6 @@ public void tagsAvailable(JSONObject tags) {
21882187
OneSignal.sendTag("a497","3");
21892188
OneSignal.sendTag("a496","2");
21902189
OneSignal.sendTag("a495","1");
2191-
OneSignal.syncHashedEmail("test1@test.com");
21922190

21932191
OneSignal.getTags(new OneSignal.OSGetTagsHandler() {
21942192
@Override
@@ -2220,10 +2218,6 @@ public void tagsAvailable(JSONObject tags) {
22202218
//Assert that the queued up operations ran in correct order
22212219
// and that the correct user state was POSTed and synced
22222220

2223-
//assert the hashed email which should be test1@test.com, NOT test@test.com
2224-
assertEquals("94fba03762323f286d7c3ca9e001c541", ShadowOneSignalRestClient.lastPost.getString("em_m"));
2225-
assertEquals("c31ddeb0a3d6cc32d82b494336d9f27444904fd7", ShadowOneSignalRestClient.lastPost.getString("em_s"));
2226-
22272221
assertNotNull(ShadowOneSignalRestClient.lastPost.getJSONObject("tags"));
22282222

22292223
JSONObject tags = ShadowOneSignalRestClient.lastPost.getJSONObject("tags");
@@ -2252,8 +2246,6 @@ public void testOneSignalEmptyPendingTaskQueue() throws Exception {
22522246

22532247
OneSignalInit(); //starts the pending tasks executor
22542248

2255-
OneSignal.syncHashedEmail("test@test.com");
2256-
22572249
for(int a = 0; a < 5; a++)
22582250
OneSignal.sendTag("a" + a, String.valueOf(a));
22592251

@@ -2265,10 +2257,6 @@ public void testOneSignalEmptyPendingTaskQueue() throws Exception {
22652257
//Assert that the queued up operations ran in correct order
22662258
// and that the correct user state was POSTed and synced
22672259

2268-
//assert the hashed email which should be test1@test.com, NOT test@test.com
2269-
assertEquals("b642b4217b34b1e8d3bd915fc65c4452", ShadowOneSignalRestClient.lastPost.getString("em_m"));
2270-
assertEquals("a6ad00ac113a19d953efb91820d8788e2263b28a", ShadowOneSignalRestClient.lastPost.getString("em_s"));
2271-
22722260
assertNotNull(ShadowOneSignalRestClient.lastPost.getJSONObject("tags"));
22732261

22742262
JSONObject tags = ShadowOneSignalRestClient.lastPost.getJSONObject("tags");
@@ -2965,40 +2953,6 @@ public void getTagsDelayedAfterRegistering() throws Exception {
29652953
assertTrue(ShadowOneSignalRestClient.lastUrl.contains(ShadowOneSignalRestClient.pushUserId));
29662954
}
29672955

2968-
2969-
@Test
2970-
public void syncHashedEmailTest() throws Exception {
2971-
OneSignalInit();
2972-
// Casing should be forced to lower.
2973-
OneSignal.syncHashedEmail("Test@tEst.CoM");
2974-
threadAndTaskWait();
2975-
assertEquals("b642b4217b34b1e8d3bd915fc65c4452" ,ShadowOneSignalRestClient.lastPost.getString("em_m"));
2976-
assertEquals("a6ad00ac113a19d953efb91820d8788e2263b28a" ,ShadowOneSignalRestClient.lastPost.getString("em_s"));
2977-
2978-
// Test email update
2979-
ShadowOneSignalRestClient.lastPost = null;
2980-
OneSignal.syncHashedEmail("test@test2.com");
2981-
threadAndTaskWait();
2982-
assertEquals("3e1163777d25d2b935057c3ae393efee" ,ShadowOneSignalRestClient.lastPost.getString("em_m"));
2983-
assertEquals("69e9ca5af84bc88bc185136cd6f782ee889be5c8" ,ShadowOneSignalRestClient.lastPost.getString("em_s"));
2984-
2985-
// Test trim on email
2986-
ShadowOneSignalRestClient.lastPost = null;
2987-
OneSignal.syncHashedEmail(" test@test2.com ");
2988-
threadAndTaskWait();
2989-
assertNull(ShadowOneSignalRestClient.lastPost);
2990-
2991-
// Test invalid email.
2992-
OneSignal.syncHashedEmail("aaaaaa");
2993-
threadAndTaskWait();
2994-
assertNull(ShadowOneSignalRestClient.lastPost);
2995-
2996-
// Test invalid email.
2997-
OneSignal.syncHashedEmail(null);
2998-
threadAndTaskWait();
2999-
assertNull(ShadowOneSignalRestClient.lastPost);
3000-
}
3001-
30022956
// ####### on_focus Tests ########
30032957

30042958
@Test

0 commit comments

Comments
 (0)