|
|
|
@ -327,7 +327,18 @@ public class DashboardControllerTest extends AbstractControllerTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testFindTenantDashboards() throws Exception { |
|
|
|
List<DashboardInfo> dashboards = new ArrayList<>(); |
|
|
|
List<DashboardInfo> expectedDashboards = new ArrayList<>(); |
|
|
|
PageLink pageLink = new PageLink(24); |
|
|
|
PageData<DashboardInfo> pageData = null; |
|
|
|
do { |
|
|
|
pageData = doGetTypedWithPageLink("/api/tenant/dashboards?", |
|
|
|
new TypeReference<PageData<DashboardInfo>>() { |
|
|
|
}, pageLink); |
|
|
|
expectedDashboards.addAll(pageData.getData()); |
|
|
|
if (pageData.hasNext()) { |
|
|
|
pageLink = pageLink.nextPageLink(); |
|
|
|
} |
|
|
|
} while (pageData.hasNext()); |
|
|
|
|
|
|
|
Mockito.reset(tbClusterService, auditLogService); |
|
|
|
|
|
|
|
@ -335,7 +346,7 @@ public class DashboardControllerTest extends AbstractControllerTest { |
|
|
|
for (int i = 0; i < cntEntity; i++) { |
|
|
|
Dashboard dashboard = new Dashboard(); |
|
|
|
dashboard.setTitle("Dashboard" + i); |
|
|
|
dashboards.add(new DashboardInfo(doPost("/api/dashboard", dashboard, Dashboard.class))); |
|
|
|
expectedDashboards.add(new DashboardInfo(doPost("/api/dashboard", dashboard, Dashboard.class))); |
|
|
|
} |
|
|
|
|
|
|
|
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new Dashboard(), new Dashboard(), |
|
|
|
@ -343,8 +354,6 @@ public class DashboardControllerTest extends AbstractControllerTest { |
|
|
|
ActionType.ADDED, cntEntity, cntEntity, cntEntity); |
|
|
|
|
|
|
|
List<DashboardInfo> loadedDashboards = new ArrayList<>(); |
|
|
|
PageLink pageLink = new PageLink(24); |
|
|
|
PageData<DashboardInfo> pageData = null; |
|
|
|
do { |
|
|
|
pageData = doGetTypedWithPageLink("/api/tenant/dashboards?", |
|
|
|
new TypeReference<PageData<DashboardInfo>>() { |
|
|
|
@ -355,10 +364,10 @@ public class DashboardControllerTest extends AbstractControllerTest { |
|
|
|
} |
|
|
|
} while (pageData.hasNext()); |
|
|
|
|
|
|
|
dashboards.sort(idComparator); |
|
|
|
expectedDashboards.sort(idComparator); |
|
|
|
loadedDashboards.sort(idComparator); |
|
|
|
|
|
|
|
Assert.assertEquals(dashboards, loadedDashboards); |
|
|
|
Assert.assertEquals(expectedDashboards, loadedDashboards); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
|