Skip to content

Commit

Permalink
fix: fix AddBulkImportUsersTest (#1084)
Browse files Browse the repository at this point in the history
* fix: fixing AddBulkImportUsersTest

* fix: fixing for mysql
  • Loading branch information
tamassoltesz authored Dec 20, 2024
1 parent bd48a11 commit e166260
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public void testWithALotOfUsers() throws Exception {

// upload a bunch of users through the API
{
for (int i = 0; i < (NUMBER_OF_USERS_TO_UPLOAD / 10000); i++) {
JsonObject request = generateUsersJson(10000, i * 10000); // API allows 10k users upload at once
for (int i = 0; i < (NUMBER_OF_USERS_TO_UPLOAD / 1000); i++) {
JsonObject request = generateUsersJson(1000, i * 1000); // API allows 10k users upload at once
JsonObject response = uploadBulkImportUsersJson(main, request);
assertEquals("OK", response.get("status").getAsString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,9 @@

package io.supertokens.test.bulkimport.apis;

import static io.supertokens.test.bulkimport.BulkImportTestUtils.generateBulkImportUser;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;

import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import io.supertokens.Main;
import io.supertokens.ProcessState;
import io.supertokens.featureflag.EE_FEATURES;
Expand All @@ -51,6 +31,18 @@
import io.supertokens.test.bulkimport.BulkImportTestUtils;
import io.supertokens.test.httpRequest.HttpRequestForTesting;
import io.supertokens.userroles.UserRoles;
import org.junit.*;
import org.junit.rules.TestRule;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;

import static io.supertokens.test.bulkimport.BulkImportTestUtils.generateBulkImportUser;
import static org.junit.Assert.*;

public class AddBulkImportUsersTest {
private String genericErrMsg = "Data has missing or invalid fields. Please check the users field for more details.";
Expand Down Expand Up @@ -551,7 +543,7 @@ public void shouldFailIfANewFieldWasAddedToBulkImportUser() throws Exception {
checkFields(user, "BulkImportUser",
Arrays.asList("id", "externalUserId", "userMetadata", "userRoles", "totpDevices",
"loginMethods", "status", "primaryUserId", "errorMessage", "createdAt",
"updatedAt"));
"updatedAt", "gson"));

checkLoginMethodFields(user.loginMethods.get(0), "LoginMethod",
Arrays.asList("tenantIds", "isVerified", "isPrimary", "timeJoinedInMSSinceEpoch",
Expand Down

0 comments on commit e166260

Please sign in to comment.