Clean up warnings in spring-test
This commit is contained in:
@@ -263,7 +263,6 @@ public class MockRestServiceServer {
|
||||
* Mock ClientHttpRequestFactory that creates requests by iterating
|
||||
* over the list of expected {@link DefaultRequestExpectation}'s.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
private class MockClientHttpRequestFactory implements ClientHttpRequestFactory, org.springframework.http.client.AsyncClientHttpRequestFactory {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -132,7 +132,6 @@ class DefaultWebTestClient implements WebTestClient {
|
||||
return toUriSpec(wc -> wc.method(HttpMethod.OPTIONS));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private <S extends RequestHeadersSpec<?>> UriSpec<S> toUriSpec(
|
||||
Function<WebClient, WebClient.UriSpec<WebClient.RequestBodySpec>> function) {
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ class FailingBeforeAndAfterMethodsSpringExtensionTestCase {
|
||||
return testClasses().map(clazz -> dynamicTest(clazz.getSimpleName(), () -> runTestAndAssertCounters(clazz)));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void runTestAndAssertCounters(Class<?> testClass) {
|
||||
Launcher launcher = LauncherFactory.create();
|
||||
ExceptionTrackingListener listener = new ExceptionTrackingListener();
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequest;
|
||||
import org.springframework.mock.http.client.MockAsyncClientHttpRequest;
|
||||
|
||||
import static junit.framework.TestCase.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -87,9 +86,10 @@ public class DefaultRequestExpectationTests {
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private ClientHttpRequest createRequest(HttpMethod method, String url) {
|
||||
try {
|
||||
return new MockAsyncClientHttpRequest(method, new URI(url));
|
||||
return new org.springframework.mock.http.client.MockAsyncClientHttpRequest(method, new URI(url));
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequest;
|
||||
import org.springframework.mock.http.client.MockAsyncClientHttpRequest;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.http.HttpMethod.GET;
|
||||
@@ -164,9 +163,10 @@ public class SimpleRequestExpectationManagerTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private ClientHttpRequest createRequest(HttpMethod method, String url) {
|
||||
try {
|
||||
return new MockAsyncClientHttpRequest(method, new URI(url));
|
||||
return new org.springframework.mock.http.client.MockAsyncClientHttpRequest(method, new URI(url));
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.test.web.client;
|
||||
|
||||
import java.net.URI;
|
||||
@@ -24,7 +25,6 @@ import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.client.ClientHttpRequest;
|
||||
import org.springframework.mock.http.client.MockAsyncClientHttpRequest;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.http.HttpMethod.GET;
|
||||
@@ -122,9 +122,10 @@ public class UnorderedRequestExpectationManagerTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private ClientHttpRequest createRequest(HttpMethod method, String url) {
|
||||
try {
|
||||
return new MockAsyncClientHttpRequest(method, new URI(url));
|
||||
return new org.springframework.mock.http.client.MockAsyncClientHttpRequest(method, new URI(url));
|
||||
}
|
||||
catch (URISyntaxException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.test.web.reactive.server.samples;
|
||||
|
||||
import java.net.URI;
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
Reference in New Issue
Block a user