Search in sources :

Example 1 with OperationParameter

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameter in project spring-boot by spring-projects.

the class OperationMethodParametersTests method assertParameters.

private void assertParameters(Stream<OperationParameter> stream) {
    List<OperationParameter> parameters = stream.collect(Collectors.toList());
    assertThat(parameters).hasSize(1);
    OperationParameter parameter = parameters.get(0);
    assertThat(parameter.getName()).isEqualTo("name");
    assertThat(parameter.getType()).isEqualTo(String.class);
}
Also used : OperationParameter(org.springframework.boot.actuate.endpoint.invoke.OperationParameter)

Example 2 with OperationParameter

use of org.springframework.boot.actuate.endpoint.invoke.OperationParameter 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));
}
Also used : DefaultParameterNameDiscoverer(org.springframework.core.DefaultParameterNameDiscoverer) OperationParameter(org.springframework.boot.actuate.endpoint.invoke.OperationParameter) Test(org.junit.jupiter.api.Test)

Aggregations

OperationParameter (org.springframework.boot.actuate.endpoint.invoke.OperationParameter)2 Test (org.junit.jupiter.api.Test)1 DefaultParameterNameDiscoverer (org.springframework.core.DefaultParameterNameDiscoverer)1