Search in sources :

Example 61 with Workbasket

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);
}
Also used : WorkbasketImpl(pro.taskana.impl.WorkbasketImpl) Workbasket(pro.taskana.Workbasket) WorkbasketResource(pro.taskana.rest.resource.WorkbasketResource) Test(org.junit.Test)

Example 62 with Workbasket

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);
}
Also used : WorkbasketResource(pro.taskana.rest.resource.WorkbasketResource) Workbasket(pro.taskana.Workbasket) Test(org.junit.Test)

Aggregations

Workbasket (pro.taskana.Workbasket)62 Test (org.junit.Test)47 WithAccessId (pro.taskana.security.WithAccessId)23 AbstractAccTest (acceptance.AbstractAccTest)18 Task (pro.taskana.Task)18 Classification (pro.taskana.Classification)17 WorkbasketService (pro.taskana.WorkbasketService)13 ArrayList (java.util.ArrayList)11 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)10 WorkbasketSummary (pro.taskana.WorkbasketSummary)9 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)9 WorkbasketNotFoundException (pro.taskana.exceptions.WorkbasketNotFoundException)9 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)8 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)7 Attachment (pro.taskana.Attachment)6 InvalidWorkbasketException (pro.taskana.exceptions.InvalidWorkbasketException)6 Instant (java.time.Instant)5 Transactional (org.springframework.transaction.annotation.Transactional)5 WorkbasketResource (pro.taskana.rest.resource.WorkbasketResource)5 Connection (java.sql.Connection)4