use of pro.taskana.ClassificationService in project taskana by Taskana.
the class GetClassificationAccTest method testGetOneClassificationByIdFails.
@Test(expected = ClassificationNotFoundException.class)
public void testGetOneClassificationByIdFails() throws ClassificationNotFoundException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
Classification classification = classificationService.getClassification("CLI:100000000470000000000000000000000011");
Assert.fail("ClassificationNotFoundException was expected");
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class GetClassificationAccTest method testGetOneClassificationForRootDomain.
@Test
public void testGetOneClassificationForRootDomain() throws ClassificationNotFoundException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
Classification classification = classificationService.getClassification("L10000", "");
Assert.assertNotNull(classification);
Assert.assertEquals("", classification.getDomain());
Assert.assertEquals(999L, classification.getPriority());
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testGetSecondPageOfClassificationQueryWithOffset.
@Test
public void testGetSecondPageOfClassificationQueryWithOffset() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").list(5, 5);
assertThat(results.size(), equalTo(5));
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testPaginationWithPages.
@Test
public void testPaginationWithPages() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// Getting full page
int pageNumber = 1;
int pageSize = 4;
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(4));
// Getting full page
pageNumber = 3;
pageSize = 4;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(4));
// Getting last results on 1 big page
pageNumber = 1;
pageSize = 100;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(17));
// Getting last results on multiple pages
pageNumber = 2;
pageSize = 10;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(7));
}
use of pro.taskana.ClassificationService in project taskana by Taskana.
the class QueryClassificationWithPaginationAccTest method testPaginationNullAndNegativeLimitsIgnoring.
@Test
public void testPaginationNullAndNegativeLimitsIgnoring() throws NotAuthorizedException {
ClassificationService classificationService = taskanaEngine.getClassificationService();
// 0 limit/size = 0 results
int pageNumber = 1;
int pageSize = 0;
List<ClassificationSummary> results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative will be 0 = all results
pageNumber = 1;
pageSize = -1;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(0));
// Negative page = first page
pageNumber = -1;
pageSize = 10;
results = classificationService.createClassificationQuery().domainIn("DOMAIN_A").listPage(pageNumber, pageSize);
assertThat(results.size(), equalTo(10));
}
Aggregations