From b7801f63115ac965f92d52f3a7df49779f7bcfbc Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 24 May 2017 15:31:06 -0400 Subject: [PATCH] Fix `CookieTests` for the latest SF https://build.spring.io/browse/INT-MASTER-679/ --- .../integration/http/outbound/CookieTests.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java index 02085ddf90..b9fe5501d6 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -33,9 +33,9 @@ import java.util.ArrayList; import java.util.List; import org.junit.Assert; - import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -43,8 +43,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.ClientHttpResponse; -import org.springframework.messaging.MessageChannel; import org.springframework.integration.channel.QueueChannel; +import org.springframework.messaging.MessageChannel; import org.springframework.messaging.support.GenericMessage; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; @@ -53,6 +53,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; /** * @author Gary Russell * @author Gunnar Hillert + * @author Artem Bilan * * @since 2.1 * @@ -74,7 +75,7 @@ public class CookieTests { @Test public void testCookie() throws Exception { - ch1.send(new GenericMessage("Hello, world!")); + ch1.send(new GenericMessage<>("Hello, world!")); Assert.assertNotNull(ch6.receive()); @@ -98,6 +99,7 @@ public class CookieTests { public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException { + return new ClientHttpRequest() { private HttpHeaders headers = new HttpHeaders(); @@ -118,6 +120,11 @@ public class CookieTests { return null; } + @Override + public String getMethodValue() { + return null; + } + public ClientHttpResponse execute() throws IOException { allHeaders.add(headers); return new ClientHttpResponse() { @@ -148,11 +155,14 @@ public class CookieTests { public int getRawStatusCode() throws IOException { return 200; } + }; } }; + } } + }