use of se.inera.intyg.webcert.common.model.GroupableItem in project webcert by sklintyg.
the class StatisticsGroupByUtilTest method testFilterAndGroupForMultipleUnitsForVardadmin.
@Test
public void testFilterAndGroupForMultipleUnitsForVardadmin() {
when(webCertUserService.getUser()).thenReturn(buildUserOfRole(AUTHORITIES_RESOLVER.getRole("VARDADMINISTRATOR")));
List<GroupableItem> queryResult = new ArrayList<>();
queryResult.add(new GroupableItem("id-1", HSA1, PNR1, FK7263));
// Not this
queryResult.add(new GroupableItem("id-2", HSA1, PNR2, FK7263));
queryResult.add(new GroupableItem("id-3", HSA1, PNR3, FK7263));
queryResult.add(new GroupableItem("id-4", HSA2, PNR3, FK7263));
queryResult.add(new GroupableItem("id-5", HSA2, PNR1, FK7263));
queryResult.add(new GroupableItem("id-6", HSA2, PNR3, FK7263));
queryResult.add(new GroupableItem("id-7", HSA2, PNR1, TSBAS));
// Never this one.
queryResult.add(new GroupableItem("id-8", HSA1, PNR2, TSBAS));
Map<String, Long> result = testee.toSekretessFilteredMap(queryResult);
assertEquals(2, result.size());
assertEquals(new Long(2L), result.get(HSA1));
assertEquals(new Long(4L), result.get(HSA2));
}
use of se.inera.intyg.webcert.common.model.GroupableItem in project webcert by sklintyg.
the class StatisticsGroupByUtilTest method testAssumeNotSekrWhenPUNotResponding.
@Test
public void testAssumeNotSekrWhenPUNotResponding() {
when(webCertUserService.getUser()).thenReturn(createUser());
List<GroupableItem> queryResult = new ArrayList<>();
queryResult.add(new GroupableItem("id-1", HSA1, PNR1, FK7263));
queryResult.add(new GroupableItem("id-2", HSA1, PNR2, FK7263));
Map<String, Long> result = testee.toSekretessFilteredMap(queryResult);
assertEquals(1, result.size());
assertEquals(new Long(2L), result.get(HSA1));
}
Aggregations