Fix HttpProxyScenarioTests for proper date format

https://build.spring.io/browse/INT-MASTERSPRING40-663/
https://build.spring.io/browse/INT-FATS5IC-832/

**Cherry-pick to 5.1.x & 5.0.x**

* Upgrade dependencies; prepare for release
This commit is contained in:
Artem Bilan
2019-04-02 09:48:18 -04:00
parent 89cf135b56
commit e50a0f506c
2 changed files with 29 additions and 28 deletions

View File

@@ -11,7 +11,7 @@ buildscript {
}
plugins {
id 'org.sonarqube' version '2.6.2'
id 'org.sonarqube' version '2.7'
id 'org.asciidoctor.convert' version '1.5.9.2'
id 'org.ajoberstar.grgit' version '3.0.0'
}
@@ -88,26 +88,26 @@ subprojects { subproject ->
ext {
activeMqVersion = '5.15.9'
apacheSshdVersion = '2.1.0'
apacheSshdVersion = '2.2.0'
aspectjVersion = '1.9.2'
assertjVersion = '3.11.1'
assertjVersion = '3.12.2'
assertkVersion = '0.13'
boonVersion = '0.34'
commonsDbcp2Version = '2.5.0'
commonsIoVersion = '2.6'
commonsNetVersion = '3.6'
curatorVersion = '4.0.1'
derbyVersion = '10.14.2.0'
eclipseLinkVersion = '2.7.3'
derbyVersion = '10.15.1.3'
eclipseLinkVersion = '2.7.4'
ftpServerVersion = '1.1.1'
googleJsr305Version = '3.0.2'
groovyVersion = '2.5.6'
guavaVersion = '26.0-jre'
hamcrestVersion = '1.3'
hazelcastVersion = '3.11.1'
hibernateVersion = '5.4.1.Final'
hazelcastVersion = '3.11.2'
hibernateVersion = '5.4.2.Final'
hsqldbVersion = '2.4.1'
h2Version = '1.4.197'
h2Version = '1.4.199'
jackson2Version = '2.9.8'
javaxActivationVersion = '1.1.1'
javaxMailVersion = '1.6.2'
@@ -118,32 +118,32 @@ subprojects { subproject ->
jschVersion = '0.1.55'
jsonpathVersion = '2.4.0'
junit4Version = '4.12'
junitJupiterVersion = '5.4.0'
junitPlatformVersion = '1.4.0'
junitJupiterVersion = '5.4.1'
junitPlatformVersion = '1.4.1'
jythonVersion = '2.7.0'
kryoShadedVersion = '4.0.2'
lettuceVersion = '5.1.6.RELEASE'
log4jVersion = '2.11.2'
micrometerVersion = '1.1.3'
mockitoVersion = '2.24.0'
mockitoVersion = '2.25.1'
mysqlVersion = '8.0.15'
pahoMqttClientVersion = '1.2.0'
postgresVersion = '42.2.5'
reactorNettyVersion = '0.8.5.RELEASE'
reactorVersion = '3.2.6.RELEASE'
reactorNettyVersion = '0.8.6.RELEASE'
reactorVersion = '3.2.8.RELEASE'
romeToolsVersion = '1.9.0'
servletApiVersion = '4.0.0'
smackVersion = '4.3.1'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.1.5.BUILD-SNAPSHOT'
springDataJpaVersion = '2.1.5.RELEASE'
springDataMongoVersion = '2.1.5.RELEASE'
springDataRedisVersion = '2.1.5.RELEASE'
springGemfireVersion = '2.1.5.RELEASE'
smackVersion = '4.3.3'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.1.5.RELEASE'
springDataJpaVersion = '2.1.6.RELEASE'
springDataMongoVersion = '2.1.6.RELEASE'
springDataRedisVersion = '2.1.6.RELEASE'
springGemfireVersion = '2.1.6.RELEASE'
springSecurityVersion = '5.1.4.RELEASE'
springRetryVersion = '1.2.4.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.1.6.BUILD-SNAPSHOT'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.1.6.RELEASE'
springWsVersion = '3.0.7.RELEASE'
tomcatVersion = "9.0.16"
tomcatVersion = "9.0.17"
xstreamVersion = '1.4.11.1'
}

View File

@@ -28,6 +28,7 @@ import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Locale;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -49,8 +50,7 @@ import org.springframework.messaging.PollableChannel;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
@@ -64,10 +64,10 @@ import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;
/**
* @author Artem Bilan
* @author Gary Russell
*
* @since 3.0
*/
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@RunWith(SpringRunner.class)
@DirtiesContext
public class HttpProxyScenarioTests {
@@ -89,8 +89,9 @@ public class HttpProxyScenarioTests {
@Test
public void testHttpProxyScenario() throws Exception {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.RFC_1123_DATE_TIME;
ZoneId GMT = ZoneId.of("GMT");
DateTimeFormatter dateTimeFormatter =
DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).withZone(GMT);
Calendar c = Calendar.getInstance();
c.set(Calendar.MILLISECOND, 0);
@@ -132,7 +133,7 @@ public class HttpProxyScenarioTests {
assertEquals(ifUnmodifiedSinceValue, httpHeaders.getFirst("If-Unmodified-Since"));
assertEquals("Keep-Alive", httpHeaders.getFirst("Connection"));
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<String, String>(httpHeaders);
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<>(httpHeaders);
responseHeaders.set("Connection", "close");
responseHeaders.set("Content-Disposition", contentDispositionValue);
return new ResponseEntity<>(responseHeaders, HttpStatus.OK);
@@ -189,7 +190,7 @@ public class HttpProxyScenarioTests {
assertThat(entity.getBody(), instanceOf(byte[].class));
assertEquals("foo", new String((byte[]) entity.getBody()));
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<String, String>(httpHeaders);
MultiValueMap<String, String> responseHeaders = new LinkedMultiValueMap<>(httpHeaders);
responseHeaders.set("Connection", "close");
responseHeaders.set("Content-Type", "text/plain");
return new ResponseEntity<Object>(responseHeaders, HttpStatus.OK);