For base class functionality, see {@link NamedValueArgumentResolverTests}.
*
* @author Rossen Stoyanchev
@@ -37,18 +37,9 @@ class CookieValueArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
-
-
- // Base class functionality should be tested in NamedValueArgumentResolverTests.
-
@Test
void cookieValue() {
this.service.execute("test");
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java
index d4185496f2..97335dd58a 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpMethodArgumentResolverTests.java
@@ -16,7 +16,6 @@
package org.springframework.web.service.invoker;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpMethod;
@@ -34,18 +33,11 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Olga Maciaszek-Sharma
* @author Rossen Stoyanchev
*/
-public class HttpMethodArgumentResolverTests {
+class HttpMethodArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
-
-
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
@Test
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpRequestValuesTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpRequestValuesTests.java
index 7d2428975d..55d26409c9 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpRequestValuesTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpRequestValuesTests.java
@@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
-public class HttpRequestValuesTests {
+class HttpRequestValuesTests {
@Test
void defaultUri() {
@@ -49,6 +49,7 @@ public class HttpRequestValuesTests {
@ParameterizedTest
@ValueSource(strings = {"POST", "PUT", "PATCH"})
+ @SuppressWarnings("unchecked")
void requestParamAsFormData(String httpMethod) {
HttpRequestValues requestValues = HttpRequestValues.builder().setHttpMethod(HttpMethod.valueOf(httpMethod))
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java
index beb6482db0..47ccdff83c 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/HttpServiceMethodTests.java
@@ -21,7 +21,6 @@ import java.util.Optional;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Single;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -52,20 +51,13 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
*
* @author Rossen Stoyanchev
*/
-public class HttpServiceMethodTests {
+class HttpServiceMethodTests {
private static final ParameterizedTypeReference For base class functionality, see {@link NamedValueArgumentResolverTests}.
*
* @author Olga Maciaszek-Sharma
@@ -36,18 +36,9 @@ class PathVariableArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
-
-
- // Base class functionality should be tested in NamedValueArgumentResolverTests.
-
@Test
void pathVariable() {
this.service.execute("test");
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestAttributeArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestAttributeArgumentResolverTests.java
index 61ec118c22..4a63af4358 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestAttributeArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestAttributeArgumentResolverTests.java
@@ -16,7 +16,6 @@
package org.springframework.web.service.invoker;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.lang.Nullable;
@@ -35,18 +34,9 @@ class RequestAttributeArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
-
-
- // Base class functionality should be tested in NamedValueArgumentResolverTests.
-
@Test
void cookieValue() {
this.service.execute("test");
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestBodyArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestBodyArgumentResolverTests.java
index 1fe0d7b657..d74da77f31 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestBodyArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestBodyArgumentResolverTests.java
@@ -18,7 +18,6 @@ package org.springframework.web.service.invoker;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Single;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
@@ -36,18 +35,11 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
*
* @author Rossen Stoyanchev
*/
-public class RequestBodyArgumentResolverTests {
+class RequestBodyArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
-
-
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
@Test
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestParamArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestParamArgumentResolverTests.java
index 07da632ae8..8a6f29ddbf 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestParamArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestParamArgumentResolverTests.java
@@ -18,7 +18,6 @@ package org.springframework.web.service.invoker;
import java.util.List;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.util.MultiValueMap;
@@ -38,24 +37,15 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
-public class RequestParamArgumentResolverTests {
+class RequestParamArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
- private Service service;
+ private final Service service = HttpServiceProxyFactory.builder(this.client).build().createClient(Service.class);
- @BeforeEach
- void setUp() throws Exception {
- HttpServiceProxyFactory proxyFactory = HttpServiceProxyFactory.builder(this.client).build();
- this.service = proxyFactory.createClient(Service.class);
- }
-
-
- // Base class functionality should be tested in NamedValueArgumentResolverTests.
- // Form data vs query params tested in HttpRequestValuesTests.
-
@Test
+ @SuppressWarnings("unchecked")
void requestParam() {
this.service.postForm("value 1", "value 2");
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestPartArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestPartArgumentResolverTests.java
index 67d53b4da9..ba768c7a31 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/RequestPartArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/RequestPartArgumentResolverTests.java
@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Rossen Stoyanchev
*/
-public class RequestPartArgumentResolverTests {
+class RequestPartArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
diff --git a/spring-web/src/test/java/org/springframework/web/service/invoker/UrlArgumentResolverTests.java b/spring-web/src/test/java/org/springframework/web/service/invoker/UrlArgumentResolverTests.java
index 6e6ccfa240..3f236e0056 100644
--- a/spring-web/src/test/java/org/springframework/web/service/invoker/UrlArgumentResolverTests.java
+++ b/spring-web/src/test/java/org/springframework/web/service/invoker/UrlArgumentResolverTests.java
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
*
* @author Rossen Stoyanchev
*/
-public class UrlArgumentResolverTests {
+class UrlArgumentResolverTests {
private final TestHttpClientAdapter client = new TestHttpClientAdapter();
diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestBodyMethodArgumentResolverTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestBodyMethodArgumentResolverTests.java
index 2992dac9d6..9b91d7835c 100644
--- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestBodyMethodArgumentResolverTests.java
+++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestBodyMethodArgumentResolverTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2020 the original author or authors.
+ * Copyright 2002-2022 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.