Search in sources :

Example 11 with WorkbasketImpl

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

the class WorkbasketServiceImplIntAutocommitTest method createTestWorkbasket.

private Workbasket createTestWorkbasket(String id, String key, String domain, String name, WorkbasketType type) throws NotAuthorizedException {
    WorkbasketImpl wb = (WorkbasketImpl) workBasketService.newWorkbasket(key, domain);
    wb.setId(id);
    wb.setName(name);
    wb.setDescription("Description of a Workbasket...");
    wb.setType(type);
    return wb;
}
Also used : WorkbasketImpl(pro.taskana.impl.WorkbasketImpl)

Example 12 with WorkbasketImpl

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

the class WorkbasketMapper method toModel.

public Workbasket toModel(WorkbasketResource wbResource) throws NotAuthorizedException {
    WorkbasketImpl workbasket = (WorkbasketImpl) workbasketService.newWorkbasket(wbResource.key, wbResource.domain);
    BeanUtils.copyProperties(wbResource, workbasket);
    workbasket.setId(wbResource.workbasketId);
    workbasket.setModified(Instant.parse(wbResource.modified));
    workbasket.setCreated(Instant.parse(wbResource.created));
    return workbasket;
}
Also used : WorkbasketImpl(pro.taskana.impl.WorkbasketImpl)

Example 13 with WorkbasketImpl

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

the class WorkbasketMapperTest method workbasketToResource.

@Test
public void workbasketToResource() throws NotAuthorizedException, WorkbasketNotFoundException {
    // given
    Workbasket workbasket = workbasketService.newWorkbasket("1", "DOMAIN_A");
    ((WorkbasketImpl) workbasket).setId("ID");
    workbasket.setType(WorkbasketType.PERSONAL);
    workbasket.setName("Testbasket");
    workbasket.setOrgLevel1("Org1");
    workbasket.setOrgLevel2("Org2");
    workbasket.setOrgLevel3("Org3");
    workbasket.setOrgLevel4("Org4");
    workbasket.setDescription("A test workbasket");
    workbasket.setCustom1("1");
    workbasket.setCustom2("2");
    workbasket.setCustom3("3");
    workbasket.setCustom4("4");
    workbasket.setOwner("Lars");
    ((WorkbasketImpl) workbasket).setCreated(Instant.parse("2010-01-01T12:00:00Z"));
    ((WorkbasketImpl) workbasket).setModified(Instant.parse("2010-01-01T12:00:00Z"));
    // when
    WorkbasketResource workbasketResource = workbasketMapper.toResource(workbasket);
    // then
    testEquality(workbasket, workbasketResource);
}
Also used : WorkbasketImpl(pro.taskana.impl.WorkbasketImpl) Workbasket(pro.taskana.Workbasket) WorkbasketResource(pro.taskana.rest.resource.WorkbasketResource) Test(org.junit.Test)

Aggregations

WorkbasketImpl (pro.taskana.impl.WorkbasketImpl)13 Test (org.junit.Test)7 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)6 Task (pro.taskana.Task)5 WithAccessId (pro.taskana.security.WithAccessId)5 ClassificationImpl (pro.taskana.impl.ClassificationImpl)4 TaskImpl (pro.taskana.impl.TaskImpl)4 Connection (java.sql.Connection)3 Classification (pro.taskana.Classification)3 Workbasket (pro.taskana.Workbasket)3 TaskanaEngineConfiguration (pro.taskana.configuration.TaskanaEngineConfiguration)2 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)2 SqlSession (org.apache.ibatis.session.SqlSession)1 KeyDomain (pro.taskana.KeyDomain)1 TaskSummary (pro.taskana.TaskSummary)1 TaskServiceImpl (pro.taskana.impl.TaskServiceImpl)1 TaskanaEngineImpl (pro.taskana.impl.TaskanaEngineImpl)1 TaskanaEngineProxyForTest (pro.taskana.impl.TaskanaEngineProxyForTest)1 WorkbasketMapper (pro.taskana.mappings.WorkbasketMapper)1 WorkbasketResource (pro.taskana.rest.resource.WorkbasketResource)1