Search in sources :

Example 6 with SelectedItem

use of pro.taskana.impl.SelectedItem in project taskana by Taskana.

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("EXTERN");
    s1.setLowerAgeLimit(-5);
    s1.setUpperAgeLimit(-2);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("AUTOMATIC");
    s2.setLowerAgeLimit(Integer.MIN_VALUE);
    s2.setUpperAgeLimit(-11);
    selectedItems.add(s2);
    SelectedItem s3 = new SelectedItem();
    s3.setKey("MANUAL");
    s3.setLowerAgeLimit(0);
    s3.setUpperAgeLimit(0);
    selectedItems.add(s3);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(null, null, null, null, customField, customFieldValues, columnHeaders, selectedItems);
    assertEquals(5, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomField(pro.taskana.CustomField) ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Aggregations

ArrayList (java.util.ArrayList)6 Test (org.junit.Test)6 TaskMonitorService (pro.taskana.TaskMonitorService)6 SelectedItem (pro.taskana.impl.SelectedItem)6 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)6 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)6 CustomField (pro.taskana.CustomField)1 TaskState (pro.taskana.TaskState)1