use of pro.taskana.impl.report.impl.CustomFieldValueReport in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2.
@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_2;
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
assertNotNull(report);
assertEquals(2, report.rowSize());
assertEquals(21, report.getRow("Vollkasko").getTotalValue());
assertEquals(29, report.getRow("Teilkasko").getTotalValue());
assertEquals(0, report.getRow("Vollkasko").getCells().length);
assertEquals(0, report.getRow("Teilkasko").getCells().length);
assertEquals(50, report.getSumRow().getTotalValue());
}
use of pro.taskana.impl.report.impl.CustomFieldValueReport in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, customFieldValues, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(1, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 11, 4, 3, 4, 3 }, row1);
}
use of pro.taskana.impl.report.impl.CustomFieldValueReport in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1.
@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
assertEquals(0, report.getRow("Geschaeftsstelle A").getCells().length);
assertEquals(0, report.getRow("Geschaeftsstelle B").getCells().length);
assertEquals(0, report.getRow("Geschaeftsstelle C").getCells().length);
assertEquals(50, report.getSumRow().getTotalValue());
}
use of pro.taskana.impl.report.impl.CustomFieldValueReport in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithDomainFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithDomainFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<String> domains = Collections.singletonList("DOMAIN_A");
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, domains, customField, null, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 8, 1, 1, 4, 1 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 2, 2, 0, 1, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 1, 1, 1, 0, 3 }, row3);
}
use of pro.taskana.impl.report.impl.CustomFieldValueReport in project taskana by Taskana.
the class TaskMonitorServiceImplTest method testGetCustomFieldValueReportWithReportLineItemDefinitions.
@Test
public void testGetCustomFieldValueReportWithReportLineItemDefinitions() throws InvalidArgumentException {
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
List<TaskState> states = Arrays.asList(TaskState.CLAIMED, TaskState.READY);
List<String> categories = Collections.singletonList("EXTERN");
List<String> domains = Collections.singletonList("DOMAIN_A");
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
List<TimeIntervalColumnHeader> reportLineItemDefinitions = Collections.singletonList(new TimeIntervalColumnHeader(0, 0));
List<MonitorQueryItem> expectedResult = new ArrayList<>();
MonitorQueryItem monitorQueryItem = new MonitorQueryItem();
monitorQueryItem.setKey("Geschaeftsstelle A");
monitorQueryItem.setAgeInDays(0);
monitorQueryItem.setNumberOfTasks(1);
expectedResult.add(monitorQueryItem);
doReturn(expectedResult).when(taskMonitorMapperMock).getTaskCountOfCustomFieldValues(workbasketIds, states, categories, domains, customField, customFieldValues);
CustomFieldValueReport actualResult = cut.getCustomFieldValueReport(workbasketIds, states, categories, domains, customField, customFieldValues, reportLineItemDefinitions);
verify(taskanaEngineImplMock, times(1)).openConnection();
verify(taskanaEngineImplMock, times(2)).getConfiguration();
verify(taskanaEngineConfiguration, times(1)).isGermanPublicHolidaysEnabled();
verify(taskanaEngineConfiguration, times(1)).getCustomHolidays();
verify(taskMonitorMapperMock, times(1)).getTaskCountOfCustomFieldValues(any(), any(), any(), any(), any(), any());
verify(taskanaEngineImplMock, times(1)).returnConnection();
verifyNoMoreInteractions(taskanaEngineImplMock, taskMonitorMapperMock, taskanaEngineConfiguration);
assertNotNull(actualResult);
assertEquals(actualResult.getRow("Geschaeftsstelle A").getTotalValue(), 1);
assertEquals(actualResult.getRow("Geschaeftsstelle A").getCells()[0], 1);
assertEquals(actualResult.getSumRow().getTotalValue(), 1);
}
Aggregations