@@ -265,9 +265,71 @@ public void shouldImportSucceedWithoutAccountLinkingEnabled() throws Exception {
265265 }
266266
267267 FeatureFlagTestContent .getInstance (main ).setKeyValue (FeatureFlagTestContent .ENABLED_FEATURES ,
268- new EE_FEATURES [] { EE_FEATURES .MULTI_TENANCY });
268+ new EE_FEATURES []{EE_FEATURES .MULTI_TENANCY });
269+
270+ BulkImportTestUtils .createTenants (process );
271+
272+ String userJsonStr = """
273+ {
274+ "externalUserId":"some-text-you-like",
275+ "userRoles":[
276+ {
277+ "role":"user",
278+ "tenantIds":[
279+ "public",
280+ "t1"
281+ ]
282+ }
283+ ],
284+ "loginMethods":[
285+ {
286+ "tenantIds":[
287+ "public",
288+ "t1"
289+ ],
290+ "isVerified":true,
291+ "isPrimary":false,
292+ "timeJoinedInMSSinceEpoch":1506523117518,
293+ "recipeId":"emailpassword",
294+ "email":"something0@testing.com",
295+ // passwordHash is randomly generated
296+ "passwordHash":"$argon2id$v=19$m=23298,t=5,p=12$+AlWgiuzC2vqlKrde9G0SG$PmpDeTU2e6ORbHwUMi7MOavS0M3sUJlc9rX/o+nnSxt",
297+ "hashingAlgorithm":"argon2"
298+ }
299+ ]
300+ }""" ;
301+
302+ String user2JsonStr = """
303+ {
304+ "userRoles":[
305+ {
306+ "role":"user",
307+ "tenantIds":[
308+ "public",
309+ "t1"
310+ ]
311+ }
312+ ],
313+ "loginMethods":[
314+ {
315+ "tenantIds":[
316+ "public",
317+ "t1"
318+ ],
319+ "isVerified":true,
320+ "isPrimary":false,
321+ "timeJoinedInMSSinceEpoch":1506523117518,
322+ "recipeId":"emailpassword",
323+ "email":"something1@testing.com",
324+ // passwordHash is randomly generated
325+ "passwordHash":"$argon2id$v=19$m=23298,t=5,p=12$+AlWgiuzC2vqlKrde9G0SG$PmpDeTU2e6ORbHwUMi7MOavS0M3sUJlc9rX/o+nnSxt",
326+ "hashingAlgorithm":"argon2"
327+ }
328+ ]
329+ }""" ;
330+ // Create user roles
331+ UserRoles .createNewRoleOrModifyItsPermissions (main , "user" , null );
269332
270- String userJsonStr = "{\" id\" :\" random-id-lol\" ,\" loginMethods\" :[{\" tenantIds\" :[\" public\" ],\" isVerified\" :true,\" isPrimary\" :false,\" timeJoinedInMSSinceEpoch\" :1741077729471,\" recipeId\" :\" emailpassword\" ,\" email\" :\" test@sometestmail.com\" ,\" passwordHash\" :\" $2a\" ,\" hashingAlgorithm\" :\" BCRYPT\" }]}" ;
271333 JsonObject request = new Gson ().fromJson (userJsonStr , JsonObject .class );
272334
273335 JsonObject response = HttpRequestForTesting .sendJsonPOSTRequest (main , "" ,
@@ -277,6 +339,14 @@ public void shouldImportSucceedWithoutAccountLinkingEnabled() throws Exception {
277339 assertEquals ("OK" , response .get ("status" ).getAsString ());
278340 assertNotNull (response .get ("user" ));
279341
342+ request = new Gson ().fromJson (user2JsonStr , JsonObject .class );
343+ JsonObject response2 = HttpRequestForTesting .sendJsonPOSTRequest (main , "" ,
344+ "http://localhost:3567/bulk-import/import" ,
345+ request , 1000 , 1000 , null , Utils .getCdiVersionStringLatestForTests (), null );
346+
347+ assertEquals ("OK" , response .get ("status" ).getAsString ());
348+ assertNotNull (response .get ("user" ));
349+
280350 process .kill ();
281351 Assert .assertNotNull (process .checkOrWaitForEvent (ProcessState .PROCESS_STATE .STOPPED ));
282352 }
0 commit comments