Search in sources :

Example 6 with WorkbasketResource

use of pro.taskana.rest.resource.WorkbasketResource 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

WorkbasketResource (pro.taskana.rest.resource.WorkbasketResource)6 Workbasket (pro.taskana.Workbasket)5 Transactional (org.springframework.transaction.annotation.Transactional)3 Test (org.junit.Test)2 InvalidWorkbasketException (pro.taskana.exceptions.InvalidWorkbasketException)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ResponseEntity (org.springframework.http.ResponseEntity)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1 WorkbasketAccessItem (pro.taskana.WorkbasketAccessItem)1 DomainNotFoundException (pro.taskana.exceptions.DomainNotFoundException)1 InvalidArgumentException (pro.taskana.exceptions.InvalidArgumentException)1 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)1 WorkbasketAlreadyExistException (pro.taskana.exceptions.WorkbasketAlreadyExistException)1 WorkbasketNotFoundException (pro.taskana.exceptions.WorkbasketNotFoundException)1 WorkbasketImpl (pro.taskana.impl.WorkbasketImpl)1 WorkbasketAccessItemResource (pro.taskana.rest.resource.WorkbasketAccessItemResource)1 WorkbasketDefinition (pro.taskana.rest.resource.WorkbasketDefinition)1