Skip to content

Commit

Permalink
fix: PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Jun 18, 2024
1 parent 77cb57c commit 78979f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws S
result.add("deletedIds", new JsonArray());
result.add("invalidIds", new JsonArray());
super.sendJsonResponse(200, result, resp);
return;
}

if (arr.size() > BulkImport.DELETE_USERS_MAX_LIMIT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,6 @@ public void shouldReturn400Error() throws Exception {
e.getMessage());
}
}
{
try {
JsonObject request = new JsonParser().parse("{\"ids\":[]}").getAsJsonObject();
HttpRequestForTesting.sendJsonPOSTRequest(main, "",
"http://localhost:3567/bulk-import/users/remove",
request, 1000, 1000, null, Utils.getCdiVersionStringLatestForTests(), null);
fail("The API should have thrown an error");
} catch (io.supertokens.test.httpRequest.HttpResponseException e) {
assertEquals(400, e.statusCode);
assertEquals("Http error. Status Code: 400. Message: Field name 'ids' cannot be an empty array",
e.getMessage());
}
}
{
try {
// Create a string array of 500 uuids
Expand Down Expand Up @@ -140,13 +127,13 @@ public void shouldReturn200Response() throws Exception {

// Call the API with empty array
{
JsonObject request = new JsonParser().parse("{\"ids\":[\"\"]}").getAsJsonObject();
JsonObject resonse = HttpRequestForTesting.sendJsonPOSTRequest(main, "",
JsonObject request = new JsonParser().parse("{\"ids\":[]}").getAsJsonObject();
JsonObject response = HttpRequestForTesting.sendJsonPOSTRequest(main, "",
"http://localhost:3567/bulk-import/users/remove",
request, 1000, 1000, null, Utils.getCdiVersionStringLatestForTests(), null);

assertEquals(0, resonse.get("deletedIds").getAsJsonArray().size());
assertEquals(0, resonse.get("invalidIds").getAsJsonArray().size());
assertEquals(0, response.get("deletedIds").getAsJsonArray().size());
assertEquals(0, response.get("invalidIds").getAsJsonArray().size());
}

{
Expand Down

0 comments on commit 78979f4

Please sign in to comment.