Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix AddBulkImportUsersTest #1084

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading