Skip to content
Snippets Groups Projects
Commit d82e874e authored by felmer's avatar felmer
Browse files

SSDM-2366: making ReportingServiceTest more robust.

parent 45367a99
No related branches found
No related tags found
No related merge requests found
...@@ -107,6 +107,9 @@ public class ReportingServiceTest extends AbstractFileTest ...@@ -107,6 +107,9 @@ public class ReportingServiceTest extends AbstractFileTest
String sessionToken = as.login(TEST_USER, PASSWORD); String sessionToken = as.login(TEST_USER, PASSWORD);
ReportingServiceSearchCriteria searchCriteria = new ReportingServiceSearchCriteria(); ReportingServiceSearchCriteria searchCriteria = new ReportingServiceSearchCriteria();
ReportingServiceFetchOptions fetchOptions = new ReportingServiceFetchOptions(); ReportingServiceFetchOptions fetchOptions = new ReportingServiceFetchOptions();
List<String> allDataSetTypeCodes = as.searchDataSetTypes(sessionToken, new DataSetTypeSearchCriteria(),
new DataSetTypeFetchOptions()).getObjects().stream().map(t -> t.getCode()).collect(Collectors.toList());
Collections.sort(allDataSetTypeCodes);
// When // When
List<ReportingService> services = as.searchReportingServices(sessionToken, searchCriteria, fetchOptions).getObjects(); List<ReportingService> services = as.searchReportingServices(sessionToken, searchCriteria, fetchOptions).getObjects();
...@@ -121,9 +124,6 @@ public class ReportingServiceTest extends AbstractFileTest ...@@ -121,9 +124,6 @@ public class ReportingServiceTest extends AbstractFileTest
services.stream().map(s -> s.getLabel()).collect(Collectors.toList()).toString()); services.stream().map(s -> s.getLabel()).collect(Collectors.toList()).toString());
assertEquals("[]", services.get(0).getDataSetTypeCodes().toString()); assertEquals("[]", services.get(0).getDataSetTypeCodes().toString());
assertEquals("[]", services.get(3).getDataSetTypeCodes().toString()); assertEquals("[]", services.get(3).getDataSetTypeCodes().toString());
List<String> allDataSetTypeCodes = as.searchDataSetTypes(sessionToken, new DataSetTypeSearchCriteria(),
new DataSetTypeFetchOptions()).getObjects().stream().map(t -> t.getCode()).collect(Collectors.toList());
Collections.sort(allDataSetTypeCodes);
assertEquals(allDataSetTypeCodes.toString(), getSortedDataSetTypeCodes(services.get(1)).toString()); assertEquals(allDataSetTypeCodes.toString(), getSortedDataSetTypeCodes(services.get(1)).toString());
assertEquals(allDataSetTypeCodes.toString(), getSortedDataSetTypeCodes(services.get(2)).toString()); assertEquals(allDataSetTypeCodes.toString(), getSortedDataSetTypeCodes(services.get(2)).toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment