DATACMNS-1087 - Fixed Vavr Option creation from present value.
We now reflectively invoke the static method Option.of(…), while we previously tried to invoke an instance method on the parameter value.
This commit is contained in:
@@ -525,7 +525,7 @@ public abstract class QueryExecutionConverters {
|
||||
*/
|
||||
@Override
|
||||
protected Object wrap(Object source) {
|
||||
return ReflectionUtils.invokeMethod(OF_METHOD, source);
|
||||
return ReflectionUtils.invokeMethod(OF_METHOD, null, source);
|
||||
}
|
||||
|
||||
public static WrapperType getWrapperType() {
|
||||
|
||||
@@ -303,6 +303,16 @@ public class QueryExecutionConvertersUnitTests {
|
||||
assertThat(allowedPageableTypes, hasItem(io.vavr.collection.Seq.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void convertsValueToVavrOption() {
|
||||
|
||||
io.vavr.control.Option<String> result = conversionService.convert(new NullableWrapper("foo"),
|
||||
io.vavr.control.Option.class);
|
||||
|
||||
assertThat(result, is(vavrOption("foo")));
|
||||
|
||||
}
|
||||
|
||||
// Vavr
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user