Clean up warnings across code base

This commit is contained in:
Sam Brannen
2017-01-07 01:44:55 +01:00
parent 055da43e30
commit 9ed66bf2eb
51 changed files with 167 additions and 214 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 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.
@@ -136,7 +136,7 @@ public abstract class AbstractHttpRequestFactoryTestCase extends AbstractMockWeb
StreamUtils.copy(body, request.getBody());
}
ClientHttpResponse response = request.execute();
request.execute();
FileCopyUtils.copy(body, request.getBody());
}

View File

@@ -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.
@@ -16,10 +16,6 @@
package org.springframework.http.server.reactive;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.isA;
import static org.mockito.Mockito.mock;
import java.io.IOException;
import org.junit.Test;
@@ -27,8 +23,12 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import org.springframework.core.io.buffer.DataBuffer;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.isA;
import static org.mockito.Mockito.mock;
import static org.junit.Assert.assertTrue;
/**
@@ -40,8 +40,8 @@ import static org.junit.Assert.assertTrue;
public class ListenerReadPublisherTests {
@Test
@SuppressWarnings("unchecked")
public void testReceiveTwoRequestCallsWhenOnSubscribe() {
@SuppressWarnings("unchecked")
Subscriber<DataBuffer> subscriber = mock(Subscriber.class);
doAnswer(new SubscriptionAnswer()).when(subscriber).onSubscribe(isA(Subscription.class));
@@ -84,4 +84,5 @@ public class ListenerReadPublisherTests {
}
}
}

View File

@@ -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.
@@ -35,6 +35,8 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.ClassPathResource;
@@ -50,7 +52,6 @@ import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.client.Netty4ClientHttpRequestFactory;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.http.client.OkHttpClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.http.converter.json.MappingJacksonValue;
import org.springframework.util.LinkedMultiValueMap;
@@ -67,17 +68,18 @@ public class RestTemplateIntegrationTests extends AbstractMockWebServerTestCase
private RestTemplate template;
@Parameterized.Parameter
@Parameter
public ClientHttpRequestFactory clientHttpRequestFactory;
@Parameterized.Parameters
@Parameters
@SuppressWarnings("deprecation")
public static Iterable<? extends ClientHttpRequestFactory> data() {
return Arrays.asList(
new SimpleClientHttpRequestFactory(),
new HttpComponentsClientHttpRequestFactory(),
new Netty4ClientHttpRequestFactory(),
new OkHttp3ClientHttpRequestFactory(),
new OkHttpClientHttpRequestFactory()
new org.springframework.http.client.OkHttpClientHttpRequestFactory()
);
}