Browse Source

Avoid use of GenericTypeResolver.resolveParameterType() in tests

This commit avoids the use of the deprecated
GenericTypeResolver.resolveParameterType() method in tests in order to
avoid warnings in the Gradle build.
pull/23435/head
Sam Brannen 7 years ago
parent
commit
d32cb7dac3
  1. 4
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SessionAttributeMethodArgumentResolverTests.java
  2. 4
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractRequestAttributesArgumentResolverTests.java

4
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SessionAttributeMethodArgumentResolverTests.java

@ -26,7 +26,6 @@ import reactor.test.StepVerifier; @@ -26,7 +26,6 @@ import reactor.test.StepVerifier;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter;
import org.springframework.core.ReactiveAdapterRegistry;
import org.springframework.core.annotation.SynthesizingMethodParameter;
@ -139,8 +138,7 @@ public class SessionAttributeMethodArgumentResolverTests { @@ -139,8 +138,7 @@ public class SessionAttributeMethodArgumentResolverTests {
private MethodParameter initMethodParameter(int parameterIndex) {
MethodParameter param = new SynthesizingMethodParameter(this.handleMethod, parameterIndex);
param.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
GenericTypeResolver.resolveParameterType(param, this.resolver.getClass());
return param;
return param.withContainingClass(this.resolver.getClass());
}

4
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/AbstractRequestAttributesArgumentResolverTests.java

@ -25,7 +25,6 @@ import org.junit.Before; @@ -25,7 +25,6 @@ import org.junit.Before;
import org.junit.Test;
import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.SynthesizingMethodParameter;
import org.springframework.core.convert.support.DefaultConversionService;
@ -153,8 +152,7 @@ public abstract class AbstractRequestAttributesArgumentResolverTests { @@ -153,8 +152,7 @@ public abstract class AbstractRequestAttributesArgumentResolverTests {
private MethodParameter initMethodParameter(int parameterIndex) {
MethodParameter param = new SynthesizingMethodParameter(this.handleMethod, parameterIndex);
param.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
GenericTypeResolver.resolveParameterType(param, this.resolver.getClass());
return param;
return param.withContainingClass(this.resolver.getClass());
}

Loading…
Cancel
Save