OverviewFactory { public JsonNode createDeleted(Execution execution, Date date) { ObjectMapper mapper = new ObjectMapper(); ObjectNode rootNode = mapper.createObjectNode(); rootNode.set("@context", createContextForDeleted(mapper)); rootNode.put("@id", execution.getIri() + "/overview"); ObjectNode executionNode = mapper.createObjectNode(); executionNode.put("@id", execution.getIri()); rootNode.set("execution", executionNode); ObjectNode statusNode = mapper.createObjectNode(); statusNode.put("@id", ExecutionStatus.DELETED.asStr()); rootNode.set("status", statusNode); String lastChange = dateFormat.format(date); rootNode.put("lastChange", lastChange); return rootNode; }  JsonNode createDeleted(Execution execution, Date date); JsonNode createQueued(Execution execution);  }
@Test public void loadFromJsonDeleted() { Date date = new Date(); Execution execution = Mockito.mock(Execution.class); String iri = "http: Mockito.when(execution.getIri()).thenReturn(iri); OverviewObject overview = OverviewObject.fromJson( overviewFactory.createDeleted(execution, date)); Assert.assertEquals( ExecutionStatus.DELETED.asStr(), overview.getStatus()); Assert.assertEquals(date, overview.getLastChange()); }