Search in sources :

Example 11 with ClassificationSummary

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());
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 12 with ClassificationSummary

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());
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 13 with ClassificationSummary

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());
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 14 with ClassificationSummary

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());
}
Also used : SQLException(java.sql.SQLException) List(java.util.List) ClassificationNotFoundException(pro.taskana.exceptions.ClassificationNotFoundException) Assert.assertNotNull(org.junit.Assert.assertNotNull) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) NotAuthorizedException(pro.taskana.exceptions.NotAuthorizedException) Test(org.junit.Test) ClassificationSummary(pro.taskana.ClassificationSummary) Collectors(java.util.stream.Collectors) Assert.assertEquals(org.junit.Assert.assertEquals) InvalidArgumentException(pro.taskana.exceptions.InvalidArgumentException) ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 15 with ClassificationSummary

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();
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) Classification(pro.taskana.Classification) Connection(java.sql.Connection) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

ClassificationSummary (pro.taskana.ClassificationSummary)51 Test (org.junit.Test)38 AbstractAccTest (acceptance.AbstractAccTest)21 Classification (pro.taskana.Classification)20 ClassificationService (pro.taskana.ClassificationService)20 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)14 Connection (java.sql.Connection)7 Attachment (pro.taskana.Attachment)7 Duration (java.time.Duration)5 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)5 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Task (pro.taskana.Task)4 ClassificationNotFoundException (pro.taskana.exceptions.ClassificationNotFoundException)4 SystemException (pro.taskana.exceptions.SystemException)4 WithAccessId (pro.taskana.security.WithAccessId)4 PersistenceException (org.apache.ibatis.exceptions.PersistenceException)3 SQLException (java.sql.SQLException)2