DATACMNS-1087 - Polishing.
Fixed Javadoc. Removed unnecessary warnings supression. Additional test to verify Vavr empty Option creation.
This commit is contained in:
committed by
Oliver Gierke
parent
e1761f6c8c
commit
6f0e025679
@@ -67,6 +67,7 @@ import com.google.common.base.Optional;
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author Maciek Opała
|
||||
* @author Jacek Jackowiak
|
||||
* @since 1.8
|
||||
*/
|
||||
public abstract class QueryExecutionConverters {
|
||||
@@ -483,7 +484,6 @@ public abstract class QueryExecutionConverters {
|
||||
* @see org.springframework.data.repository.util.QueryExecutionConverters.AbstractWrapperTypeConverter#wrap(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Object wrap(Object source) {
|
||||
return ReflectionUtils.invokeMethod(OF_METHOD, null, source);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ public abstract class QueryExecutionConverters {
|
||||
}
|
||||
|
||||
/**
|
||||
* Converter to convert from {@link NullableWrapper} into JavaSlang's {@link io.vavr.control.Option}.
|
||||
* Converter to convert from {@link NullableWrapper} into Vavr's {@link io.vavr.control.Option}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @since 2.0
|
||||
@@ -511,7 +511,7 @@ public abstract class QueryExecutionConverters {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link NullableWrapperToJavaslangOptionConverter} using the given {@link ConversionService}.
|
||||
* Creates a new {@link NullableWrapperToVavrOptionConverter} using the given {@link ConversionService}.
|
||||
*
|
||||
* @param conversionService must not be {@literal null}.
|
||||
*/
|
||||
|
||||
@@ -303,14 +303,24 @@ public class QueryExecutionConvertersUnitTests {
|
||||
assertThat(allowedPageableTypes, hasItem(io.vavr.collection.Seq.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // DATACMNS-1087
|
||||
@SuppressWarnings("unchecked")
|
||||
public void convertsValueToVavrOption() {
|
||||
|
||||
io.vavr.control.Option<String> result = conversionService.convert(new NullableWrapper("foo"),
|
||||
io.vavr.control.Option.class);
|
||||
|
||||
assertThat(result, is(vavrOption("foo")));
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1087
|
||||
@SuppressWarnings("unchecked")
|
||||
public void convertsValueToEmptyVavrOption() {
|
||||
|
||||
io.vavr.control.Option<Object> result = conversionService.convert(new NullableWrapper(null),
|
||||
io.vavr.control.Option.class);
|
||||
|
||||
assertThat(result, is(vavrOptionNone()));
|
||||
}
|
||||
|
||||
// Vavr
|
||||
|
||||
Reference in New Issue
Block a user