@Test
void should_ReturnRepresentationModel_When_ConvertingEntityToRepresentationModel()
    throws Exception {

  ObjectReference primaryObjRef = new ObjectReference();
  primaryObjRef.setId("abc");
  ClassificationSummary classification =
      this.classificationService.newClassification("ckey", "cdomain", "MANUAL").asSummary();
  AttachmentSummaryImpl attachment =
      (AttachmentSummaryImpl) this.taskService.newAttachment().asSummary();
  attachment.setClassificationSummary(classification);
  attachment.setId("attachmentId");
  final WorkbasketSummary workbasket =
      this.workbasketService.newWorkbasket("key", "domain").asSummary();
  TaskSummaryImpl task = (TaskSummaryImpl) this.taskService.newTask().asSummary();
  task.setAttachmentSummaries(Collections.singletonList(attachment));
  task.setClassificationSummary(classification);
  task.setWorkbasketSummary(workbasket);
  task.setId("taskId");
  task.setExternalId("externalId");
  task.setCreated(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setClaimed(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setCompleted(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setModified(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setPlanned(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setDue(Instant.parse("2019-09-13T08:44:17.588Z"));
  task.setName("name");
  task.setCreator("creator");
  task.setDescription("desc");
  task.setNote("note");
  task.setPriority(123);
  task.setState(TaskState.READY);
  task.setBusinessProcessId("businessProcessId");
  task.setParentBusinessProcessId("parentBusinessProcessId");
  task.setOwner("owner");
  task.setPrimaryObjRef(primaryObjRef);
  task.setRead(true);
  task.setTransferred(true);
  task.setCustom1("custom1");
  task.setCustom2("custom2");
  task.setCustom3("custom3");
  task.setCustom4("custom4");
  task.setCustom5("custom5");
  task.setCustom6("custom6");
  task.setCustom7("custom7");
  task.setCustom8("custom8");
  task.setCustom9("custom9");
  task.setCustom10("custom10");
  task.setCustom11("custom11");
  task.setCustom12("custom12");
  task.setCustom13("custom13");
  task.setCustom14("custom14");
  task.setCustom15("custom15");
  task.setCustom16("custom16");
  TaskSummaryRepresentationModel repModel = assembler.toModel(task);
  testEquality(task, repModel);
  testLinks(repModel);
}