INT-3217 Update Default Spring to 3.2.5

JIRA: https://jira.springsource.org/browse/INT-3217

INT-3217 Polishing

PR Comments

Also fixes some other warnings (mainly unused imports).
This commit is contained in:
Gary Russell
2013-11-26 19:27:19 +02:00
committed by Artem Bilan
parent db32486d35
commit 4a3ba5abd0
23 changed files with 99 additions and 62 deletions

View File

@@ -107,11 +107,12 @@ public class HttpProxyScenarioTests {
RestTemplate template = Mockito.spy(new RestTemplate());
Mockito.doAnswer(new Answer<ResponseEntity<?>>() {
@SuppressWarnings("deprecation")
@Override
public ResponseEntity<?> answer(InvocationOnMock invocation) throws Throwable {
URI uri = (URI) invocation.getArguments()[0];
assertEquals(new URI("http://testServer/test?foo=bar&FOO=BAR"), uri);
HttpEntity<?> httpEntity = (HttpEntity) invocation.getArguments()[2];
HttpEntity<?> httpEntity = (HttpEntity<?>) invocation.getArguments()[2];
HttpHeaders httpHeaders = httpEntity.getHeaders();
assertEquals(ifModifiedSince, httpHeaders.getIfNotModifiedSince());
assertEquals(ifUnmodifiedSinceValue, httpHeaders.getFirst("If-Unmodified-Since"));

View File

@@ -16,9 +16,9 @@
package org.springframework.integration.http.config;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
@@ -28,6 +28,7 @@ import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -167,7 +168,6 @@ public class HttpOutboundChannelAdapterParserTests {
}
@Test
@SuppressWarnings("uchecked")
public void withUrlAndTemplate() {
DirectFieldAccessor endpointAccessor = new DirectFieldAccessor(this.withUrlAndTemplate);
RestTemplate restTemplate =
@@ -257,10 +257,12 @@ public class HttpOutboundChannelAdapterParserTests {
public static class StubErrorHandler implements ResponseErrorHandler {
@Override
public boolean hasError(ClientHttpResponse response) throws IOException {
return false;
}
@Override
public void handleError(ClientHttpResponse response) throws IOException {
}
}

View File

@@ -18,8 +18,8 @@ package org.springframework.integration.http.support;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.net.URI;
import java.text.ParseException;
@@ -33,10 +33,10 @@ import java.util.Locale;
import java.util.Map;
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;
@@ -577,6 +577,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
public static class TestClassConverter implements Converter<TestClass, String>{
@Override
public String convert(TestClass source) {
return "TestClass.class";
}

View File

@@ -386,6 +386,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
// If-Modified-Since tests
@SuppressWarnings("deprecation")
@Test
public void validateIfModifiedSinceAsNumber() throws ParseException{
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
@@ -399,6 +400,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
assertEquals(simpleDateFormat.parse("Thu, 01 Jan 1970 03:25:45 GMT").getTime(), headers.getIfNotModifiedSince());
}
@SuppressWarnings("deprecation")
@Test
public void validateIfModifiedSinceAsString() throws ParseException{
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
@@ -411,6 +413,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
assertEquals(simpleDateFormat.parse("Thu, 01 Jan 1970 03:25:45 GMT").getTime(), headers.getIfNotModifiedSince());
}
@SuppressWarnings("deprecation")
@Test
public void validateIfModifiedSinceAsDate() throws ParseException{
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
@@ -673,6 +676,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
assertEquals(0, messageHeaders.size());
}
@SuppressWarnings("deprecation")
public void testInt2995IfModifiedSince() throws Exception{
Date ifModifiedSince = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.US);