DATACMNS-1762 - Support Optional wrapping for projection getters.
We now support nullable wrappers for projection interfaces. Getters are inspected whether their return type is a supported nullable wrapper. If so, then the value can be wrapped into that type. Null values default in that case to their corresponding empty wrapper representation. Original Pull Request: #459
This commit is contained in:
committed by
Christoph Strobl
parent
04f59f1307
commit
bd3992dfc5
@@ -74,12 +74,11 @@ class ProjectingMethodInterceptorUnitTests {
|
||||
assertThat(methodInterceptor.invoke(invocation)).isEqualTo("Foo");
|
||||
}
|
||||
|
||||
@Test // DATAREST-221
|
||||
@Test // DATAREST-221, DATACMNS-1762
|
||||
void returnsNullAsIs() throws Throwable {
|
||||
|
||||
MethodInterceptor methodInterceptor = new ProjectingMethodInterceptor(factory, interceptor, conversionService);
|
||||
|
||||
when(interceptor.invoke(invocation)).thenReturn(null);
|
||||
mockInvocationOf("getString", null);
|
||||
|
||||
assertThat(methodInterceptor.invoke(invocation)).isNull();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user