@Override
    protected InputStream getRequestStream(Exchange exchange) throws SalesforceException {
        InputStream request;
        Message in = exchange.getIn();
        request = in.getBody(InputStream.class);
        if (request == null) {
            AbstractDTOBase dto = in.getBody(AbstractDTOBase.class);
            if (dto != null) {
                // marshall the DTO
                request = getRequestStream(in, dto);
            } else {
                // if all else fails, get body as String
                final String body = in.getBody(String.class);
                if (null == body) {
                    String msg = "Unsupported request message body " + (in.getBody() == null ? null : in.getBody().getClass());
                    throw new SalesforceException(msg, null);
                } else {
                    request = new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8));
                }
            }
        }

        return request;
    }
@Test
    public void shouldSerializeNullValues() throws SalesforceException, IOException {
        final SalesforceComponent salesforce = new SalesforceComponent();
        final SalesforceEndpointConfig configuration = new SalesforceEndpointConfig();
        final SalesforceEndpoint endpoint
                = new SalesforceEndpoint("", salesforce, configuration, OperationName.UPDATE_SOBJECT, "");

        final JsonRestProcessor jsonProcessor = new JsonRestProcessor(endpoint);

        final Message in = new DefaultMessage(new DefaultCamelContext());
        TestObject testObject = new TestObject();
        testObject.getFieldsToNull().add("creationDate");
        try (InputStream stream = jsonProcessor.getRequestStream(in, testObject);
             InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
            final String json = IOUtils.toString(reader);
            assertThat(json)
                    .isEqualTo("{\"creationDate\":null,\"attributes\":{\"referenceId\":null,\"type\":null,\"url\":null}}");
        }
    }