Search in sources :

Example 1 with WorkbasketSummaryImpl

use of pro.taskana.impl.WorkbasketSummaryImpl in project taskana by Taskana.

the class TaskServiceImplIntExplicitTest method createTaskShouldThrowWorkbasketNotFoundException.

@WithAccessId(userName = "Elena", groupNames = { "businessadmin" })
@Test(expected = WorkbasketNotFoundException.class)
public void createTaskShouldThrowWorkbasketNotFoundException() throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, SQLException, ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
    Connection connection = dataSource.getConnection();
    taskanaEngineImpl.setConnection(connection);
    generateSampleAccessItems();
    Task test = this.generateDummyTask();
    ((WorkbasketSummaryImpl) (test.getWorkbasketSummary())).setId("2");
    taskServiceImpl.createTask(test);
}
Also used : Task(pro.taskana.Task) WorkbasketSummaryImpl(pro.taskana.impl.WorkbasketSummaryImpl) Connection(java.sql.Connection) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test) WithAccessId(pro.taskana.security.WithAccessId)

Example 2 with WorkbasketSummaryImpl

use of pro.taskana.impl.WorkbasketSummaryImpl in project taskana by Taskana.

the class WorkbasketSummaryMapperTest method workbasketSummaryToResource.

@Test
public void workbasketSummaryToResource() throws WorkbasketNotFoundException, NotAuthorizedException {
    // given
    WorkbasketSummaryImpl workbasketSummary = (WorkbasketSummaryImpl) workbasketService.newWorkbasket("1", "DOMAIN_A").asSummary();
    workbasketSummary.setDescription("WorkbasketSummaryImplTes");
    workbasketSummary.setId("1");
    workbasketSummary.setName("WorkbasketSummary");
    workbasketSummary.setOrgLevel1("Org1");
    workbasketSummary.setOrgLevel2("Org2");
    workbasketSummary.setOrgLevel3("Org3");
    workbasketSummary.setOrgLevel4("Org4");
    workbasketSummary.setOwner("Lars");
    workbasketSummary.setType(WorkbasketType.PERSONAL);
    // when
    WorkbasketSummaryResource workbasketSummaryResource = workbasketSummaryMapper.toResource(workbasketSummary);
    // then
    Assert.assertEquals(workbasketSummary.getDescription(), workbasketSummaryResource.description);
    Assert.assertEquals(workbasketSummary.getDomain(), workbasketSummaryResource.domain);
    Assert.assertEquals(workbasketSummary.getId(), workbasketSummaryResource.workbasketId);
    Assert.assertEquals(workbasketSummary.getKey(), workbasketSummaryResource.key);
    Assert.assertEquals(workbasketSummary.getName(), workbasketSummaryResource.name);
    Assert.assertEquals(workbasketSummary.getOrgLevel1(), workbasketSummaryResource.orgLevel1);
    Assert.assertEquals(workbasketSummary.getOrgLevel2(), workbasketSummaryResource.orgLevel2);
    Assert.assertEquals(workbasketSummary.getOrgLevel3(), workbasketSummaryResource.orgLevel3);
    Assert.assertEquals(workbasketSummary.getOrgLevel4(), workbasketSummaryResource.orgLevel4);
    Assert.assertEquals(workbasketSummary.getOwner(), workbasketSummaryResource.owner);
    Assert.assertEquals(workbasketSummary.getType(), workbasketSummaryResource.type);
}
Also used : WorkbasketSummaryImpl(pro.taskana.impl.WorkbasketSummaryImpl) WorkbasketSummaryResource(pro.taskana.rest.resource.WorkbasketSummaryResource) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 WorkbasketSummaryImpl (pro.taskana.impl.WorkbasketSummaryImpl)2 Connection (java.sql.Connection)1 Task (pro.taskana.Task)1 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)1 WorkbasketSummaryResource (pro.taskana.rest.resource.WorkbasketSummaryResource)1 WithAccessId (pro.taskana.security.WithAccessId)1