Skip to content

Commit fa9e5b7

Browse files
committed
DATACMNS-1552 - Test case to verify Option values are returned as is.
Make sure that the fix for DATACMNS-1524 fixes this ticket as well. A bit of whitespace in QueryExecutionResultHandler.
1 parent 0defbe3 commit fa9e5b7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: src/main/java/org/springframework/data/repository/core/support/QueryExecutionResultHandler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private static Object unwrapOptional(@Nullable Object source) {
167167

168168
/**
169169
* Returns whether we have to process the given source object in the first place.
170-
*
170+
*
171171
* @param source can be {@literal null}.
172172
* @param targetType must not be {@literal null}.
173173
* @return

Diff for: src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java

+8
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@ public void nestedConversion() throws Exception {
405405
});
406406
}
407407

408+
@Test // DATACMNS-1552
409+
public void keepsVavrOptionType() throws Exception {
410+
411+
Option<Entity> source = Option.of(new Entity());
412+
413+
assertThat(handler.postProcessInvocationResult(source, getMethod("option"))).isSameAs(source);
414+
}
415+
408416
private static Method getMethod(String methodName) throws Exception {
409417
return Sample.class.getMethod(methodName);
410418
}

0 commit comments

Comments
 (0)