Browse Source

Rename PAGE_SIZE to SMALL_PAGE_SIZE for clarity

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pull/15200/head
Sergey Matvienko 7 months ago
parent
commit
611004327d
  1. 12
      application/src/test/java/org/thingsboard/server/controller/AuditLogControllerTest.java

12
application/src/test/java/org/thingsboard/server/controller/AuditLogControllerTest.java

@ -63,7 +63,7 @@ import static org.mockito.Mockito.verify;
public class AuditLogControllerTest extends AbstractControllerTest { public class AuditLogControllerTest extends AbstractControllerTest {
// Small enough to force multiple pages, verifying pagination loop correctness // Small enough to force multiple pages, verifying pagination loop correctness
private static final int PAGE_SIZE = 5; private static final int SMALL_PAGE_SIZE = 5;
private Tenant savedTenant; private Tenant savedTenant;
private User tenantAdmin; private User tenantAdmin;
@ -117,13 +117,13 @@ public class AuditLogControllerTest extends AbstractControllerTest {
} }
Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() ->
assertThat(getAuditLogs(PAGE_SIZE, "/api/audit/logs?")).hasSize(11 + 1)); assertThat(getAuditLogs(SMALL_PAGE_SIZE, "/api/audit/logs?")).hasSize(11 + 1));
Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() ->
assertThat(getAuditLogs(PAGE_SIZE, "/api/audit/logs/customer/" + ModelConstants.NULL_UUID + "?")).hasSize(11 + 1)); assertThat(getAuditLogs(SMALL_PAGE_SIZE, "/api/audit/logs/customer/" + ModelConstants.NULL_UUID + "?")).hasSize(11 + 1));
Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() ->
assertThat(getAuditLogs(PAGE_SIZE, "/api/audit/logs/user/" + tenantAdmin.getId().getId().toString() + "?")).hasSize(11 + 1)); assertThat(getAuditLogs(SMALL_PAGE_SIZE, "/api/audit/logs/user/" + tenantAdmin.getId().getId().toString() + "?")).hasSize(11 + 1));
} }
@Test @Test
@ -171,7 +171,7 @@ public class AuditLogControllerTest extends AbstractControllerTest {
} }
Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() ->
assertThat(getAuditLogs(PAGE_SIZE, "/api/audit/logs/entity/DEVICE/" + savedDevice.getId().getId() + "?")).hasSize(11 + 1)); assertThat(getAuditLogs(SMALL_PAGE_SIZE, "/api/audit/logs/entity/DEVICE/" + savedDevice.getId().getId() + "?")).hasSize(11 + 1));
} }
@Test @Test
@ -188,7 +188,7 @@ public class AuditLogControllerTest extends AbstractControllerTest {
tenantProfile = doPost("/api/tenantProfile", tenantProfile, TenantProfile.class); tenantProfile = doPost("/api/tenantProfile", tenantProfile, TenantProfile.class);
Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> Awaitility.await().atMost(TIMEOUT, TimeUnit.SECONDS).untilAsserted(() ->
assertThat(getAuditLogs(PAGE_SIZE, "/api/audit/logs/entity/" + tenantProfile.getId().getEntityType() + "/" + tenantProfile.getId().getId() + "?")) assertThat(getAuditLogs(SMALL_PAGE_SIZE, "/api/audit/logs/entity/" + tenantProfile.getId().getEntityType() + "/" + tenantProfile.getId().getId() + "?"))
.as("Audit logs count by Tenant Profile entity").hasSize(2)); .as("Audit logs count by Tenant Profile entity").hasSize(2));
//cleanup //cleanup

Loading…
Cancel
Save