use of org.springframework.core.DefaultParameterNameDiscoverer in project spring-framework by spring-projects.
the class RequestAttributeMethodArgumentResolverTests method initMethodParameter.
private MethodParameter initMethodParameter(int parameterIndex) {
MethodParameter param = new SynthesizingMethodParameter(this.handleMethod, parameterIndex);
param.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
GenericTypeResolver.resolveParameterType(param, this.resolver.getClass());
return param;
}
use of org.springframework.core.DefaultParameterNameDiscoverer in project spring-boot by spring-projects.
the class OperationMethodParametersTests method iteratorShouldIterateOperationParameters.
@Test
void iteratorShouldIterateOperationParameters() {
OperationMethodParameters parameters = new OperationMethodParameters(this.exampleMethod, new DefaultParameterNameDiscoverer());
Iterator<OperationParameter> iterator = parameters.iterator();
assertParameters(StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false));
}
use of org.springframework.core.DefaultParameterNameDiscoverer in project spring-boot by spring-projects.
the class OperationMethodParametersTests method hasParametersWhenHasNoParametersShouldReturnFalse.
@Test
void hasParametersWhenHasNoParametersShouldReturnFalse() {
OperationMethodParameters parameters = new OperationMethodParameters(this.exampleNoParamsMethod, new DefaultParameterNameDiscoverer());
assertThat(parameters.hasParameters()).isFalse();
}
use of org.springframework.core.DefaultParameterNameDiscoverer in project spring-boot by spring-projects.
the class OperationMethodParametersTests method getParameterCountShouldReturnParameterCount.
@Test
void getParameterCountShouldReturnParameterCount() {
OperationMethodParameters parameters = new OperationMethodParameters(this.exampleMethod, new DefaultParameterNameDiscoverer());
assertThat(parameters.getParameterCount()).isEqualTo(1);
}
use of org.springframework.core.DefaultParameterNameDiscoverer in project spring-boot by spring-projects.
the class OperationMethodParametersTests method hasParametersWhenHasParametersShouldReturnTrue.
@Test
void hasParametersWhenHasParametersShouldReturnTrue() {
OperationMethodParameters parameters = new OperationMethodParameters(this.exampleMethod, new DefaultParameterNameDiscoverer());
assertThat(parameters.hasParameters()).isTrue();
}
Aggregations