### Question:
IngestionSerializer implements ComprehendSerializer<JsonNode> { public JsonNode deserialize(@NonNull final String input){ try { return mapper.readTree(input); } catch (IOException e) { throw new InternalErrorException(CustomerMessage.INTERNAL_ERROR, e); } }  JsonNode deserialize(@NonNull final String input); String serialize(@NonNull final JsonNode input);  }### Answer:
@Test public void succeedDeserializeJsonNode() { test = new IngestionSerializer(mapper); JsonNode result = test.deserialize(TestConstants.CUSTOMER_INGESTION_PAYLOAD); assertEquals(result.get(TestConstants.CUSTOMER_INGESTION_PAYLOAD_NAME_KEY).asText(), TestConstants.CUSTOMER_INGESTION_PAYLOAD_NAME); assertEquals(result.get(TestConstants.CUSTOMER_INGESTION_PAYLOAD_LOCATION_KEY).asText(), TestConstants.CUSTOMER_INGESTION_PAYLOAD_LOCATION); assertEquals(result.get(TestConstants.CUSTOMER_INGESTION_PAYLOAD_TEXT_KEY).asText(), TestConstants.CUSTOMER_INGESTION_PAYLOAD_TEXT); }
@Test(expected = InternalErrorException.class) public void failedDeserializeJsonNode() throws IOException { ObjectMapper mockBadMapper = mock(ObjectMapper.class); when(mockBadMapper.readTree(anyString())).thenThrow(new IOException()); test = new IngestionSerializer(mockBadMapper); test.deserialize(TestConstants.CUSTOMER_INGESTION_PAYLOAD); }