use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testFindWithClassificationMapperDomainAndCategory.
@Test
public void testFindWithClassificationMapperDomainAndCategory() throws ClassificationAlreadyExistException, NotAuthorizedException, ClassificationNotFoundException, DomainNotFoundException, InvalidArgumentException {
Classification classification1 = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification1.setCategory("EXTERNAL");
classificationService.createClassification(classification1);
Classification classification2 = this.createDummyClassificationWithUniqueKey("DOMAIN_B", "TASK");
classification2.setCategory("EXTERNAL");
classificationService.createClassification(classification2);
Classification classification3 = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification3.setCategory("MANUAL");
classificationService.createClassification(classification3);
List<ClassificationSummary> list = classificationService.createClassificationQuery().categoryIn("EXTERNAL").domainIn("DOMAIN_A").list();
Assert.assertEquals(1, list.size());
list = classificationService.createClassificationQuery().domainIn("DOMAIN_A", "DOMAIN_C").list();
Assert.assertEquals(2, list.size());
}
use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testFindWithClassificationMapperServiceLevelNameAndDescription.
@Test
public void testFindWithClassificationMapperServiceLevelNameAndDescription() throws ClassificationAlreadyExistException, NotAuthorizedException, ClassificationNotFoundException, DomainNotFoundException, InvalidArgumentException {
int all = 0;
Classification classification = this.createDummyClassificationWithUniqueKey("", "TASK");
classification.setServiceLevel("P1D");
classification.setName("name1");
classification.setDescription("desc");
classificationService.createClassification(classification);
all++;
Classification classification1 = this.createDummyClassificationWithUniqueKey("", "TASK");
classification1.setServiceLevel("P1DT1H");
classification1.setName("name1");
classification1.setDescription("desc");
classificationService.createClassification(classification1);
all++;
Classification classification2 = this.createDummyClassificationWithUniqueKey("", "TASK");
classification2.setServiceLevel("P1D");
classification2.setName("name");
classification2.setDescription("desc");
classificationService.createClassification(classification2);
all++;
Classification classification3 = this.createDummyClassificationWithUniqueKey("", "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());
}
use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testUpdateAndClassificationMapper.
@Test
public void testUpdateAndClassificationMapper() throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException, ConcurrencyException, DomainNotFoundException, InvalidArgumentException {
Classification classification = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification = classificationService.createClassification(classification);
classification.setDescription("description");
classification = classificationService.updateClassification(classification);
List<ClassificationSummary> list = classificationService.createClassificationQuery().validInDomainEquals(true).list();
Assert.assertEquals(1, list.size());
classification = classificationService.updateClassification(classification);
list = classificationService.createClassificationQuery().list();
Assert.assertEquals(2, list.size());
List<ClassificationSummary> allClassifications = classificationService.createClassificationQuery().list();
Assert.assertEquals(2, allClassifications.size());
}
use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testDefaultSettingsWithClassificationMapper.
@Test
public void testDefaultSettingsWithClassificationMapper() throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException, ConcurrencyException, DomainNotFoundException, InvalidArgumentException {
Classification classification = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification = classificationService.createClassification(classification);
Classification classification1 = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification1 = classificationService.createClassification(classification1);
classification1.setParentId(classification.getId());
classification1 = classificationService.updateClassification(classification1);
List<ClassificationSummary> list = classificationService.createClassificationQuery().parentIdIn("").list();
Assert.assertEquals(3, list.size());
list = classificationService.createClassificationQuery().list();
Assert.assertEquals(4, list.size());
List<ClassificationSummary> listAll = classificationService.createClassificationQuery().list();
list = classificationService.createClassificationQuery().list();
Assert.assertEquals(listAll.size(), list.size());
list = classificationService.createClassificationQuery().validInDomainEquals(true).list();
Assert.assertEquals(2, list.size());
list = classificationService.createClassificationQuery().createdWithin(today()).list();
Assert.assertEquals(4, list.size());
list = classificationService.createClassificationQuery().domainIn("DOMAIN_C").validInDomainEquals(false).list();
Assert.assertEquals(0, list.size());
list = classificationService.createClassificationQuery().list();
Assert.assertEquals(4, list.size());
}
use of pro.taskana.ClassificationSummary in project taskana by Taskana.
the class QueryClassificationAccTest method testGetClassificationsWithParentKey.
@Test
public void testGetClassificationsWithParentKey() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> classifications = classificationService.createClassificationQuery().keyIn("A12", "A13").categoryIn("EXTERNAL", "MANUAL").parentIdIn("CLI:100000000000000000000000000000000014").list();
assertNotNull(classifications);
assertEquals(1, classifications.size());
classifications = classificationService.createClassificationQuery().keyIn("A12", "A13").categoryIn("EXTERNAL", "MANUAL", "AUTOMATIC").parentIdIn("CLI:100000000000000000000000000000000014", "CLI:100000000000000000000000000000000010", "CLI:100000000000000000000000000000000011").domainIn("DOMAIN_A").list();
assertNotNull(classifications);
assertEquals(2, classifications.size());
}
Aggregations