From 7812f87f31ab53e1b47f5a8ec7caedd39d8b1c93 Mon Sep 17 00:00:00 2001 From: Tony K <82545368+Nsiem@users.noreply.github.com> Date: Wed, 15 Dec 2021 16:42:15 -0500 Subject: [PATCH] ISSUE-1740: Added random number generation for values between 5-20 for list+pagination testing (#1782) * ISSUE-1740: Added random number generation for values between 5-40 inclusive for maxEntities variable in get_entityListWithPagination_200 method * ISSUE-1740: Added random number generation for values between 5-20 inclusive for maxEntities variable in get_entityListWithPagination_200 method * ISSUE-1740: Added random number generation for values between 5-20 inclusive for maxEntities variable in get_entityListWithPagination_200 method --- .../openmetadata/catalog/resources/EntityResourceTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/EntityResourceTest.java b/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/EntityResourceTest.java index fbcf6705496..aa54cfad9fa 100644 --- a/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/EntityResourceTest.java +++ b/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/EntityResourceTest.java @@ -73,6 +73,7 @@ import java.util.Map.Entry; import java.util.Optional; import java.util.UUID; import java.util.function.BiConsumer; +import java.util.Random; import static javax.ws.rs.core.Response.Status.BAD_REQUEST; import static javax.ws.rs.core.Response.Status.CONFLICT; @@ -250,8 +251,10 @@ public abstract class EntityResourceTest extends CatalogApplicationTest { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @Test public void get_entityListWithPagination_200(TestInfo test) throws HttpResponseException, URISyntaxException { - // Create a large number of tables - int maxEntities = 40; + // Create a number of tables between 5 and 20 inclusive + Random rand = new Random(); + int maxEntities = rand.nextInt(16) + 5; + for (int i = 0; i < maxEntities; i++) { createEntity(createRequest(getEntityName(test, i), null, null, null), adminAuthHeaders()); }