use of pro.taskana.Workbasket 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);
}
use of pro.taskana.Workbasket in project taskana by Taskana.
the class WorkbasketMapperTest method resourceToWorkbasket.
@Test
public void resourceToWorkbasket() throws NotAuthorizedException {
// given
WorkbasketResource workbasketResource = new WorkbasketResource();
workbasketResource.setWorkbasketId("1");
workbasketResource.setCreated("2010-01-01T12:00:00Z");
workbasketResource.setModified("2010-01-01T12:00:00Z");
workbasketResource.setCustom1("Custom1");
workbasketResource.setCustom2("Custom2");
workbasketResource.setCustom3("Custom3");
workbasketResource.setCustom4("Custom4");
workbasketResource.setDescription("Test Ressource");
workbasketResource.setDomain("DOMAIN_A");
workbasketResource.setKey("1");
workbasketResource.setName("Ressource");
workbasketResource.setOrgLevel1("Org1");
workbasketResource.setOrgLevel2("Org2");
workbasketResource.setOrgLevel3("Org3");
workbasketResource.setOrgLevel4("Org4");
workbasketResource.setOwner("Lars");
workbasketResource.setType(WorkbasketType.PERSONAL);
// when
Workbasket workbasket = workbasketMapper.toModel(workbasketResource);
// then
testEquality(workbasket, workbasketResource);
}
Aggregations