use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testGetClassificationsWithParentAndCustom2.
@Test
public void testGetClassificationsWithParentAndCustom2() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().parentIdIn("CLI:100000000000000000000000000000000004").custom2Like("TEXT_1", "TEXT_2").list();
// zwei tests
assertNotNull(classifications);
assertEquals(3, classifications.size());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationAccTest method testGetClassificationsForTypeAndParent.
@Test
public void testGetClassificationsForTypeAndParent() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().typeIn("TASK", "DOCUMENT").parentIdIn("").list();
assertNotNull(classifications);
assertEquals(25, classifications.size());
List<ClassificationSummary> documentTypes = classifications.stream().filter(c -> c.getType().equals("DOCUMENT")).collect(Collectors.toList());
assertEquals(2, documentTypes.size());
List<ClassificationSummary> taskTypes = classifications.stream().filter(c -> c.getType().equals("TASK")).collect(Collectors.toList());
assertEquals(23, taskTypes.size());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class GetClassificationAccTest method testGetOneClassificationById.
@Test
public void testGetOneClassificationById() throws ClassificationNotFoundException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
Classification classification = classificationService.getClassification("CLI:100000000000000000000000000000000011");
Assert.assertNotNull(classification);
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class GetClassificationAccTest method testFindAllClassifications.
@Test
public void testFindAllClassifications() {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery().list();
Assert.assertNotNull(classificationSummaryList);
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testListOffsetAndLimitOutOfBounds.
@Test
public void testListOffsetAndLimitOutOfBounds() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// both will be 0, working
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(-1, -3);
assertThat(results.size(), equalTo(0));
// limit will be 0
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(1, -3);
assertThat(results.size(), equalTo(0));
// offset will be 0
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(-1, 3);
assertThat(results.size(), equalTo(3));
}
Aggregations