use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class DistributionTargetsAccTest method testQueryDistributionSourcesThrowsNotAuthorized.
@WithAccessId(userName = "henry", groupNames = { "undefinedgroup" })
@Test(expected = NotAuthorizedException.class)
public void testQueryDistributionSourcesThrowsNotAuthorized() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("WBI:100000000000000000000000000000000004");
assertEquals(2, distributionSources.size());
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class DistributionTargetsAccTest method testGetDistributionSourcesById.
@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test
public void testGetDistributionSourcesById() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("WBI:100000000000000000000000000000000004");
assertEquals(2, distributionSources.size());
List<String> expectedIds = new ArrayList<>(Arrays.asList("WBI:100000000000000000000000000000000001", "WBI:100000000000000000000000000000000002"));
for (WorkbasketSummary foundSummary : distributionSources) {
assertTrue(expectedIds.contains(foundSummary.getId()));
}
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class DistributionTargetsAccTest method testAddDistributionTargetsFailsNotAuthorized.
@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test(expected = NotAuthorizedException.class)
public void testAddDistributionTargetsFailsNotAuthorized() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
Workbasket workbasket = workbasketService.getWorkbasket("GPK_KSC_1", "DOMAIN_A");
List<WorkbasketSummary> distributionTargets = workbasketService.getDistributionTargets(workbasket.getId());
assertEquals(4, distributionTargets.size());
// add a new distribution target
Workbasket newTarget = workbasketService.getWorkbasket("GPK_B_KSC_2", "DOMAIN_B");
workbasketService.addDistributionTarget(workbasket.getId(), newTarget.getId());
fail("NotAuthorizedException should have been thrown");
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class DistributionTargetsAccTest method testGetDistributionSourcesByKeyDomain.
@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test
public void testGetDistributionSourcesByKeyDomain() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("TEAMLEAD_1", "DOMAIN_A");
assertEquals(2, distributionSources.size());
List<String> expectedIds = new ArrayList<>(Arrays.asList("WBI:100000000000000000000000000000000001", "WBI:100000000000000000000000000000000002"));
for (WorkbasketSummary foundSummary : distributionSources) {
assertTrue(expectedIds.contains(foundSummary.getId()));
}
}
use of pro.taskana.WorkbasketSummary in project taskana by Taskana.
the class DistributionTargetsAccTest method testQueryDistributionSourcesThrowsWorkbasketNotFound.
@WithAccessId(userName = "user_2_2", groupNames = { "group_1", "group_2" })
@Test(expected = WorkbasketNotFoundException.class)
public void testQueryDistributionSourcesThrowsWorkbasketNotFound() throws NotAuthorizedException, WorkbasketNotFoundException, InvalidWorkbasketException, SQLException {
WorkbasketService workbasketService = taskanaEngine.getWorkbasketService();
List<WorkbasketSummary> distributionSources = workbasketService.getDistributionSources("WBI:10dasgibtsdochnicht00000000000000004");
assertEquals(2, distributionSources.size());
}
Aggregations