use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class QueryClassificationAccTest method testFindClassificationsByCreatedTimestamp.
@Test
public void testFindClassificationsByCreatedTimestamp() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery().domainIn("DOMAIN_A").createdWithin(todaysInterval()).list();
assertNotNull(classificationSummaryList);
assertEquals(17, classificationSummaryList.size());
}
use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class QueryClassificationAccTest method testFindClassificationsByCategoryAndDomain.
@Test
public void testFindClassificationsByCategoryAndDomain() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery().categoryIn("MANUAL").domainIn("DOMAIN_A").list();
assertNotNull(classificationSummaryList);
assertEquals(2, classificationSummaryList.size());
}
use of pro.taskana.ClassificationSummary 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.ClassificationSummary 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.ClassificationSummary in project taskana by Taskana.
the class ClassificationServiceImplIntExplicitTest method testFindWithClassificationMapperServiceLevelNameAndDescription.
@Test
public void testFindWithClassificationMapperServiceLevelNameAndDescription() throws NotAuthorizedException, SQLException, ClassificationAlreadyExistException, ClassificationNotFoundException, DomainNotFoundException, InvalidArgumentException {
Connection connection = dataSource.getConnection();
taskanaEngineImpl.setConnection(connection);
int all = 0;
Classification classification = this.createNewClassificationWithUniqueKey("", "TASK");
classification.setServiceLevel("P1D");
classification.setName("name1");
classification.setDescription("desc");
classificationService.createClassification(classification);
all++;
Classification classification1 = this.createNewClassificationWithUniqueKey("", "TASK");
classification1.setServiceLevel("P1DT1H");
classification1.setName("name1");
classification1.setDescription("desc");
classificationService.createClassification(classification1);
all++;
Classification classification2 = this.createNewClassificationWithUniqueKey("", "TASK");
classification2.setServiceLevel("P1D");
classification2.setName("name");
classification2.setDescription("desc");
classificationService.createClassification(classification2);
all++;
Classification classification3 = this.createNewClassificationWithUniqueKey("", "TASK");
classification3.setName("name1");
classification3.setDescription("description");
classificationService.createClassification(classification3);
all++;
List<ClassificationSummary> list = classificationService.createClassificationQuery().nameIn("name").list();
Assert.assertEquals(1, list.size());
list = classificationService.createClassificationQuery().serviceLevelIn("P1D").descriptionLike("desc").list();
Assert.assertEquals(2, list.size());
list = classificationService.createClassificationQuery().serviceLevelIn("P1DT1H").nameIn("name").list();
Assert.assertEquals(0, list.size());
list = classificationService.createClassificationQuery().descriptionLike("desc%").list();
Assert.assertEquals(all, list.size());
connection.commit();
}
Aggregations