diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java index f8119f59dd..b708a48018 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/DefaultAmqpHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.integration.amqp.AmqpHeaders; import org.springframework.integration.mapping.AbstractHeaderMapper; import org.springframework.integration.mapping.support.JsonHeaders; +import org.springframework.util.MimeType; import org.springframework.util.StringUtils; /** @@ -363,7 +364,8 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper headerMap = new HashMap(); + + MimeType contentType = MimeType.valueOf("text/html"); + headerMap.put(AmqpHeaders.CONTENT_TYPE, contentType); + + MessageHeaders integrationHeaders = new MessageHeaders(headerMap); + MessageProperties amqpProperties = new MessageProperties(); + headerMapper.fromHeadersToRequest(integrationHeaders, amqpProperties); + + assertEquals("text/html", amqpProperties.getContentType()); + } + @SuppressWarnings("deprecation") @Test public void toHeaders() {