use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testGetFirstPageOfClassificationQueryWithOffset.
@Test
public void testGetFirstPageOfClassificationQueryWithOffset() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(0, 5);
assertThat(results.size(), equalTo(5));
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testGetClassificationsForKeyAndCategories.
@Test
public void testGetClassificationsForKeyAndCategories() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().keyIn("T2100", "L10000").categoryIn("EXTERNAL", "MANUAL").list();
assertNotNull(classifications);
assertEquals(5, classifications.size());
List<ClassificationSummary> externCategory = classifications.stream().filter(c -> c.getCategory().equals("EXTERNAL")).collect(Collectors.toList());
assertEquals(2, externCategory.size());
List<ClassificationSummary> manualCategory = classifications.stream().filter(c -> c.getCategory().equals("MANUAL")).collect(Collectors.toList());
assertEquals(3, manualCategory.size());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testFindClassificationsByPriorityAndValidInDomain.
@Test
public void testFindClassificationsByPriorityAndValidInDomain() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> list = classificationService.createClassificationQuery().validInDomainEquals(Boolean.TRUE).priorityIn(1, 2, 3).list();
assertEquals(14, list.size());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testGetOneClassificationForMultipleDomains.
@Test
public void testGetOneClassificationForMultipleDomains() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().keyIn("L10000").domainIn("DOMAIN_A", "DOMAIN_B", "").list();
assertNotNull(classifications);
assertEquals(2, classifications.size());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testGetClassificationsWithCustom1.
@Test
public void testGetClassificationsWithCustom1() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().custom1Like("VNR,RVNR,KOLVNR", "VNR").domainIn("DOMAIN_A").list();
assertNotNull(classifications);
assertEquals(14, classifications.size());
}
Aggregations