@Test
public void deserialize_a_serialized_contract_json_document_into_a_contract_object() throws Exception {

    Contract aSimpleContract = aSimpleContract();
    byte[] serializedContract = new ObjectMapper().writeValueAsBytes(aSimpleContract);
    ContractDeserializer contractDeserializer = new ContractDeserializer();
    Contract contract = contractDeserializer.deserialize(new JsonFactory(new ObjectMapper()).createParser(serializedContract), null);
    assertThat(contract.getInput()).extracting("name", "type").containsExactly(
            tuple("name", String.class.getName()),
            tuple("isValid", Boolean.class.getName()),
            tuple("ticket", NodeContractInput.class.getName()));
    assertThat(find(contract.getInput(), instanceOf(NodeContractInput.class)).getInput()).extracting("name", "type").containsExactly(
            tuple("title", String.class.getName()),
            tuple("creationDate", Date.class.getName()),
            tuple("creationLocalDate", LocalDate.class.getName()),
            tuple("creationLocalDateTime", LocalDateTime.class.getName()),
            tuple("creationOffsetDateTime", OffsetDateTime.class.getName()),
            tuple("updateTime", Long.class.getName()));
}