use of pro.taskana.Classification in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testInsertAndClassificationMapper.
@Test
public void testInsertAndClassificationMapper() throws NotAuthorizedException, ClassificationAlreadyExistException, ClassificationNotFoundException, InvalidArgumentException, DomainNotFoundException {
Classification classification = this.createDummyClassificationWithUniqueKey("DOMAIN_A", "TASK");
classification = classificationService.createClassification(classification);
List<ClassificationSummary> list = classificationService.createClassificationQuery().validInDomainEquals(Boolean.TRUE).createdWithin(today()).list();
Assert.assertEquals(1, list.size());
}
use of pro.taskana.Classification in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method testFindAllClassifications.
@Test
public void testFindAllClassifications() throws ClassificationAlreadyExistException, NotAuthorizedException, ClassificationNotFoundException, DomainNotFoundException, InvalidArgumentException {
Classification classification0 = this.createDummyClassificationWithUniqueKey("", "TASK");
classificationService.createClassification(classification0);
Classification classification1 = this.createDummyClassificationWithUniqueKey("", "TASK");
classificationService.createClassification(classification1);
Classification classification2 = this.createDummyClassificationWithUniqueKey("", "TASK");
classification2.setParentId(classification0.getId());
classificationService.createClassification(classification2);
Assert.assertEquals(2 + 1, classificationService.createClassificationQuery().list().size());
}
use of pro.taskana.Classification 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.Classification 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.Classification in project taskana by Taskana.
the class ClassificationServiceImplIntAutoCommitTest method createDummyClassificationWithUniqueKey.
private Classification createDummyClassificationWithUniqueKey(String domain, String type) throws NotAuthorizedException {
Classification classification = classificationService.newClassification("TEST" + counter, domain, type);
counter++;
return classification;
}
Aggregations