NodeInstanceSummaryMapper implements Function<NodeInstance, NodeInstanceSummary> { @Override public NodeInstanceSummary apply(NodeInstance nodeInstance) { if (nodeInstance == null) { return null; } return new NodeInstanceSummary(nodeInstance.getId(), nodeInstance.getProcessInstanceId(), nodeInstance.getName(), nodeInstance.getNodeId(), nodeInstance.getNodeType(), nodeInstance.getDate(), nodeInstance.getConnection(), nodeInstance.getCompleted(), nodeInstance.getReferenceId(), nodeInstance.getSlaCompliance(), nodeInstance.getSlaDueDate()); }  @Override NodeInstanceSummary apply(NodeInstance nodeInstance);  }
@Test public void testNodeInstanceSummaryMapper() { NodeInstance ni = NodeInstance.builder() .id(1l).name("name-3") .nodeId("123_123") .processInstanceId(2l) .referenceId(4l) .slaCompliance(4) .slaDueDate(new Date()) .connection("con") .workItemId(3l) .date(new Date()) .nodeType("HumanTask") .completed(true) .build(); assertNodeInstanceSummary(ni, new NodeInstanceSummaryMapper().apply(ni)); }
@Test public void testNodeInstanceSummaryMapperNull() { assertNull(new NodeInstanceSummaryMapper().apply(null)); }