@Test
void should_ReturnEntity_When_ConvertingRepresentationModelToEntity() throws Exception {

  ObjectReference primaryObjRef = new ObjectReference();
  primaryObjRef.setId("abc");
  WorkbasketSummaryRepresentationModel workbasketResource =
      new WorkbasketSummaryRepresentationModel();
  workbasketResource.setWorkbasketId("workbasketId");
  ClassificationSummaryRepresentationModel classificationSummary =
      new ClassificationSummaryRepresentationModel();
  classificationSummary.setKey("keyabc");
  classificationSummary.setDomain("DOMAIN_A");
  classificationSummary.setType("MANUAL");
  AttachmentRepresentationModel attachment = new AttachmentRepresentationModel();
  attachment.setClassificationSummary(classificationSummary);
  attachment.setAttachmentId("attachmentId");
  TaskSummaryRepresentationModel repModel = new TaskRepresentationModel();
  repModel.setAttachmentSummaries(Collections.singletonList(attachment));
  repModel.setClassificationSummary(classificationSummary);
  repModel.setWorkbasketSummary(workbasketResource);
  repModel.setPrimaryObjRef(primaryObjRef);
  repModel.setTaskId("taskId");
  repModel.setExternalId("externalId");
  repModel.setCreated(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setClaimed(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setCompleted(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setModified(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setPlanned(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setDue(Instant.parse("2019-09-13T08:44:17.588Z"));
  repModel.setName("name");
  repModel.setCreator("creator");
  repModel.setDescription("desc");
  repModel.setNote("note");
  repModel.setPriority(123);
  repModel.setState(TaskState.READY);
  repModel.setBusinessProcessId("businessProcessId");
  repModel.setParentBusinessProcessId("parentBusinessProcessId");
  repModel.setOwner("owner");
  repModel.setRead(true);
  repModel.setTransferred(true);
  repModel.setCustom1("custom1");
  repModel.setCustom2("custom2");
  repModel.setCustom3("custom3");
  repModel.setCustom4("custom4");
  repModel.setCustom5("custom5");
  repModel.setCustom6("custom6");
  repModel.setCustom7("custom7");
  repModel.setCustom8("custom8");
  repModel.setCustom9("custom9");
  repModel.setCustom10("custom10");
  repModel.setCustom11("custom11");
  repModel.setCustom12("custom12");
  repModel.setCustom13("custom13");
  repModel.setCustom14("custom14");
  repModel.setCustom15("custom15");
  repModel.setCustom16("custom16");
  // when
  TaskSummary task = assembler.toEntityModel(repModel);
  // then
  testEquality(task, repModel);
}