Skip to content

Commit 1a1b930

Browse files
committed
fixes a test - maybe
1 parent e869757 commit 1a1b930

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/test/java/io/supertokens/test/dashboard/DashboardStorageTest.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@
1616

1717
package io.supertokens.test.dashboard;
1818

19-
import static org.junit.Assert.assertEquals;
20-
import static org.junit.Assert.assertNotNull;
21-
import static org.junit.Assert.assertNull;
22-
import static org.junit.Assert.assertTrue;
23-
24-
import java.util.ArrayList;
25-
26-
import org.junit.AfterClass;
27-
import org.junit.Before;
28-
import org.junit.Rule;
29-
import org.junit.Test;
30-
import org.junit.rules.TestRule;
31-
3219
import io.supertokens.ProcessState.PROCESS_STATE;
3320
import io.supertokens.dashboard.Dashboard;
3421
import io.supertokens.pluginInterface.STORAGE_TYPE;
@@ -42,6 +29,15 @@
4229
import io.supertokens.storageLayer.StorageLayer;
4330
import io.supertokens.test.TestingProcessManager;
4431
import io.supertokens.test.Utils;
32+
import org.junit.AfterClass;
33+
import org.junit.Before;
34+
import org.junit.Rule;
35+
import org.junit.Test;
36+
import org.junit.rules.TestRule;
37+
38+
import java.util.ArrayList;
39+
40+
import static org.junit.Assert.*;
4541

4642
public class DashboardStorageTest {
4743
@Rule
@@ -59,7 +55,7 @@ public void beforeEach() {
5955

6056
@Test
6157
public void testCreateNewDashboardUser() throws Exception {
62-
String[] args = { "../" };
58+
String[] args = {"../"};
6359

6460
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
6561
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -124,7 +120,7 @@ public void testCreateNewDashboardUser() throws Exception {
124120

125121
@Test
126122
public void testGetDashboardUserFunctions() throws Exception {
127-
String[] args = { "../" };
123+
String[] args = {"../"};
128124

129125
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
130126
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -162,7 +158,7 @@ public void testGetDashboardUserFunctions() throws Exception {
162158

163159
@Test
164160
public void testGetAllDashboardUsers() throws Exception {
165-
String[] args = { "../" };
161+
String[] args = {"../"};
166162

167163
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
168164
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -178,6 +174,7 @@ public void testGetAllDashboardUsers() throws Exception {
178174
DashboardUser user = new DashboardUser(io.supertokens.utils.Utils.getUUID(), "test" + i + "@example.com",
179175
"testPasswordHash", System.currentTimeMillis());
180176
StorageLayer.getDashboardStorage(process.getProcess()).createNewDashboardUser(user);
177+
Thread.sleep(2);
181178
}
182179

183180
// retrieve all dashboard users, check that correctly created and returned in
@@ -197,7 +194,7 @@ public void testGetAllDashboardUsers() throws Exception {
197194
// test the deleteDashboardUserWithUserId function
198195
@Test
199196
public void testTheDeleteDashboardUserWithUserIdFunction() throws Exception {
200-
String[] args = { "../" };
197+
String[] args = {"../"};
201198

202199
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
203200
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -230,7 +227,7 @@ public void testTheDeleteDashboardUserWithUserIdFunction() throws Exception {
230227

231228
@Test
232229
public void testTheCreateNewDashboardUserSession() throws Exception {
233-
String[] args = { "../" };
230+
String[] args = {"../"};
234231

235232
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
236233
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -269,7 +266,7 @@ public void testTheCreateNewDashboardUserSession() throws Exception {
269266

270267
@Test
271268
public void testCreatingMultipleSessionsForAUser() throws Exception {
272-
String[] args = { "../" };
269+
String[] args = {"../"};
273270

274271
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
275272
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -321,7 +318,7 @@ public void testCreatingMultipleSessionsForAUser() throws Exception {
321318

322319
@Test
323320
public void testRevokeExpiredSessionsFunction() throws Exception {
324-
String[] args = { "../" };
321+
String[] args = {"../"};
325322

326323
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
327324
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -382,7 +379,7 @@ public void testRevokeExpiredSessionsFunction() throws Exception {
382379

383380
@Test
384381
public void testUpdatingUsersEmail() throws Exception {
385-
String[] args = { "../" };
382+
String[] args = {"../"};
386383

387384
TestingProcessManager.TestingProcess process = TestingProcessManager.start(args);
388385
assertNotNull(process.checkOrWaitForEvent(PROCESS_STATE.STARTED));
@@ -448,7 +445,8 @@ public void testUpdatingUsersEmail() throws Exception {
448445
assertEquals(1, dashboardSQLStorage.getAllDashboardUsers().length);
449446

450447
// create another user
451-
DashboardUser user2 = new DashboardUser(io.supertokens.utils.Utils.getUUID(), "[email protected]", "testpassword", System.currentTimeMillis());
448+
DashboardUser user2 = new DashboardUser(io.supertokens.utils.Utils.getUUID(), "[email protected]",
449+
"testpassword", System.currentTimeMillis());
452450
dashboardSQLStorage.createNewDashboardUser(user2);
453451

454452
// try updating user2s email with the user1s email

0 commit comments

Comments
 (0)