use of org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper in project spring-boot by spring-projects.
the class EndpointAutoConfigurationTests method mapShouldUseConfigurationConverter.
@Test
void mapShouldUseConfigurationConverter() {
this.contextRunner.withUserConfiguration(ConverterConfiguration.class).run((context) -> {
ParameterValueMapper parameterValueMapper = context.getBean(ParameterValueMapper.class);
Object paramValue = parameterValueMapper.mapParameterValue(new TestOperationParameter(Person.class), "John Smith");
assertThat(paramValue).isInstanceOf(Person.class);
Person person = (Person) paramValue;
assertThat(person.firstName).isEqualTo("John");
assertThat(person.lastName).isEqualTo("Smith");
});
}
use of org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper in project spring-boot by spring-projects.
the class EndpointAutoConfigurationTests method mapShouldUseGenericConfigurationConverter.
@Test
void mapShouldUseGenericConfigurationConverter() {
this.contextRunner.withUserConfiguration(GenericConverterConfiguration.class).run((context) -> {
ParameterValueMapper parameterValueMapper = context.getBean(ParameterValueMapper.class);
Object paramValue = parameterValueMapper.mapParameterValue(new TestOperationParameter(Person.class), "John Smith");
assertThat(paramValue).isInstanceOf(Person.class);
Person person = (Person) paramValue;
assertThat(person.firstName).isEqualTo("John");
assertThat(person.lastName).isEqualTo("Smith");
});
}
Aggregations