@Test // no asertions just a warn message in a log
  public void testWarnMessageForNonPostPutAndExtractPayload() throws Exception {
    // should see a warn message

    HttpRequestExecutingMessageHandler handler =
        new HttpRequestExecutingMessageHandler("http://www.springsource.org/spring-integration");
    MockRestTemplate template = new MockRestTemplate();
    new DirectFieldAccessor(handler).setPropertyValue("restTemplate", template);
    handler.setHttpMethod(HttpMethod.GET);
    handler.setExtractPayload(true);
    setBeanFactory(handler);
    handler.afterPropertiesSet();

    // should not see  a warn message since 'setExtractPayload' is not set explicitly

    handler =
        new HttpRequestExecutingMessageHandler("http://www.springsource.org/spring-integration");
    template = new MockRestTemplate();
    new DirectFieldAccessor(handler).setPropertyValue("restTemplate", template);
    handler.setHttpMethod(HttpMethod.GET);
    setBeanFactory(handler);
    handler.afterPropertiesSet();

    // should not see  a warn message since HTTP method is not GET

    handler =
        new HttpRequestExecutingMessageHandler("http://www.springsource.org/spring-integration");
    template = new MockRestTemplate();
    new DirectFieldAccessor(handler).setPropertyValue("restTemplate", template);
    handler.setHttpMethod(HttpMethod.POST);
    handler.setExtractPayload(true);
    setBeanFactory(handler);
    handler.afterPropertiesSet();
  }
  @Test
  public void acceptHeaderForSerializableResponseMessageExchange() throws Exception {
    HttpRequestExecutingMessageHandler handler =
        new HttpRequestExecutingMessageHandler("http://www.springsource.org/spring-integration");

    handler.setHttpMethod(HttpMethod.GET);
    handler.setExtractPayload(false);
    handler.setExpectedResponseType(GenericMessage.class);

    List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>();
    converters.add(new SerializingHttpMessageConverter());
    handler.setMessageConverters(converters);
    setBeanFactory(handler);
    handler.afterPropertiesSet();

    RestTemplate restTemplate =
        TestUtils.getPropertyValue(handler, "restTemplate", RestTemplate.class);

    HttpHeaders requestHeaders = setUpMocksToCaptureSentHeaders(restTemplate);

    Message<?> message = MessageBuilder.withPayload("foo").build();
    Exception exception = null;
    try {
      handler.handleMessage(message);
    } catch (Exception e) {
      exception = e;
    }
    assertTrue(requestHeaders.getAccept() != null);
    assertTrue(requestHeaders.getAccept().size() > 0);
    assertEquals("404 Not Found", exception.getCause().getMessage());
    List<MediaType> accept = requestHeaders.getAccept();
    assertTrue(accept != null && accept.size() > 0);
    assertEquals("application", accept.get(0).getType());
    assertEquals("x-java-serialized-object", accept.get(0).getSubtype());
  }