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;
}
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;
}
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);
}
Aggregations