Search in sources :

Example 6 with ClassificationService

use of pro.taskana.ClassificationService in project taskana by Taskana.

the class ClassificationQueryAccTest method testFindClassificationsByDomainAdmin.

@WithAccessId(userName = "admin")
@Test
public void testFindClassificationsByDomainAdmin() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    ClassificationService classificationService = taskanaEngine.getClassificationService();
    List<ClassificationSummary> classificationSummaryList = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list();
    assertNotNull(classificationSummaryList);
    assertEquals(17, classificationSummaryList.size());
}
Also used : ClassificationSummary(pro.taskana.ClassificationSummary) ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 7 with ClassificationService

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

Example 8 with ClassificationService

use of pro.taskana.ClassificationService in project taskana by Taskana.

the class QueryClassificationAccTest method testQueryClassificationValuesForColumnName.

@Test
public void testQueryClassificationValuesForColumnName() throws SQLException, ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException {
    ClassificationService classificationService = taskanaEngine.getClassificationService();
    List<String> columnValueList = classificationService.createClassificationQuery().listValues("NAME", null);
    assertNotNull(columnValueList);
    assertEquals(15, columnValueList.size());
    columnValueList = classificationService.createClassificationQuery().listValues("TYPE", null);
    assertNotNull(columnValueList);
    assertEquals(3, columnValueList.size());
    columnValueList = classificationService.createClassificationQuery().domainIn("").listValues("TYPE", null);
    assertNotNull(columnValueList);
    assertEquals(2, columnValueList.size());
    columnValueList = classificationService.createClassificationQuery().domainIn("").listValues("CREATED", null);
    assertNotNull(columnValueList);
    columnValueList = classificationService.createClassificationQuery().domainIn("").validInDomainEquals(false).listValues("VALID_IN_DOMAIN", null);
    assertNotNull(columnValueList);
    // all are false in ""
    assertEquals(1, columnValueList.size());
}
Also used : ClassificationService(pro.taskana.ClassificationService) AbstractAccTest(acceptance.AbstractAccTest) Test(org.junit.Test)

Example 9 with ClassificationService

use of pro.taskana.ClassificationService 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 10 with ClassificationService

use of pro.taskana.ClassificationService 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)

Aggregations

AbstractAccTest (acceptance.AbstractAccTest)32 Test (org.junit.Test)32 ClassificationService (pro.taskana.ClassificationService)32 ClassificationSummary (pro.taskana.ClassificationSummary)19 Classification (pro.taskana.Classification)10 WithAccessId (pro.taskana.security.WithAccessId)6 SQLException (java.sql.SQLException)2 Instant (java.time.Instant)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Assert.assertEquals (org.junit.Assert.assertEquals)2 Assert.assertNotNull (org.junit.Assert.assertNotNull)2 ClassificationNotFoundException (pro.taskana.exceptions.ClassificationNotFoundException)2 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)2 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)2 ArrayList (java.util.ArrayList)1 Ignore (org.junit.Ignore)1 Task (pro.taskana.Task)1 TaskService (pro.taskana.TaskService)1 DaysToWorkingDaysConverter (pro.taskana.impl.DaysToWorkingDaysConverter)1