From 6fcb6630d75078b1b3928cfb7ab2a68c4807cce4 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 26 Feb 2016 22:35:12 +0100 Subject: [PATCH] Clean up warnings in SampleAsyncTests --- .../web/client/samples/SampleAsyncTests.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/web/client/samples/SampleAsyncTests.java b/spring-test/src/test/java/org/springframework/test/web/client/samples/SampleAsyncTests.java index 0f372039f0..091b64d575 100644 --- a/spring-test/src/test/java/org/springframework/test/web/client/samples/SampleAsyncTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/client/samples/SampleAsyncTests.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.test.web.client.samples; -import org.junit.Before; import org.junit.Test; import org.springframework.core.io.ClassPathResource; @@ -24,7 +24,6 @@ import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.test.web.Person; -import org.springframework.test.web.client.ExpectedCount; import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.util.concurrent.ListenableFuture; import org.springframework.web.client.AsyncRestTemplate; @@ -41,21 +40,15 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat * code. * * @author Rossen Stoyanchev + * @since 4.1 */ public class SampleAsyncTests { - private MockRestServiceServer mockServer; + private final AsyncRestTemplate restTemplate = new AsyncRestTemplate(); - private AsyncRestTemplate restTemplate; + private final MockRestServiceServer mockServer = MockRestServiceServer.createServer(this.restTemplate); - @Before - public void setup() { - this.restTemplate = new AsyncRestTemplate(); - this.mockServer = MockRestServiceServer.createServer(this.restTemplate); - - } - @Test public void performGet() throws Exception { @@ -146,4 +139,5 @@ public class SampleAsyncTests { assertTrue(error.getMessage(), error.getMessage().contains("2 unsatisfied expectation(s)")); } } + }