INT-2001 updated HTTP module to remove its dependency on deprecated classes in Spring 3.1, fixed ETag test
This commit is contained in:
@@ -16,11 +16,6 @@
|
||||
|
||||
package org.springframework.integration.http.support;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import java.net.URI;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -35,7 +30,7 @@ import org.junit.Test;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
@@ -44,6 +39,12 @@ import org.springframework.integration.MessageHeaders;
|
||||
import org.springframework.integration.mapping.HeaderMapper;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Mark Fisher
|
||||
@@ -171,15 +172,14 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
|
||||
// ETag tests
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void validateETag(){
|
||||
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.inboundMapper();
|
||||
Map<String, Object> messageHeaders = new HashMap<String, Object>();
|
||||
messageHeaders.put("ETag", "1234");
|
||||
messageHeaders.put("ETag", "\"1234\"");
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
|
||||
mapper.fromHeaders(new MessageHeaders(messageHeaders), headers);
|
||||
assertEquals("1234", headers.getETag());
|
||||
assertEquals("\"1234\"", headers.getETag());
|
||||
}
|
||||
|
||||
// Expires tests
|
||||
@@ -461,7 +461,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
|
||||
public void validateCustomHeadersWithNonStringValuesAndDefaultConverterOnly() throws Exception{
|
||||
DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper();
|
||||
mapper.setOutboundHeaderNames(new String[] {"customHeader*"});
|
||||
ConversionService cs = ConversionServiceFactory.createDefaultConversionService();
|
||||
ConversionService cs = new DefaultConversionService();
|
||||
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
|
||||
beanFactory.registerSingleton("integrationConversionService", cs);
|
||||
mapper.setBeanFactory(beanFactory);
|
||||
@@ -482,7 +482,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
|
||||
public void validateCustomHeadersWithNonStringValuesAndDefaultConverterWithCustomConverter() throws Exception{
|
||||
DefaultHttpHeaderMapper mapper = new DefaultHttpHeaderMapper();
|
||||
mapper.setOutboundHeaderNames(new String[] {"customHeader*"});
|
||||
GenericConversionService cs = ConversionServiceFactory.createDefaultConversionService();
|
||||
GenericConversionService cs = new DefaultConversionService();
|
||||
cs.addConverter(new TestClassConverter());
|
||||
DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
|
||||
beanFactory.registerSingleton("integrationConversionService", cs);
|
||||
|
||||
Reference in New Issue
Block a user