From d12801a7b0fec415913b2ebc172c8662e287090e Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Wed, 20 Feb 2019 13:54:01 +0100 Subject: [PATCH] DATACMNS-1482 - Polishing. Slightly improved test case. --- .../QueryExecutionResultHandlerUnitTests.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java index 56853f613..84f20d110 100755 --- a/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java @@ -394,13 +394,14 @@ public class QueryExecutionResultHandlerUnitTests { Object result = handler.postProcessInvocationResult(asList(BigDecimal.ZERO, BigDecimal.ONE), getMethod("listOfInteger")); - assertThat(result).isInstanceOf(List.class); + assertThat(result).isInstanceOfSatisfying(List.class, list -> { - List list = (List) result; - SoftAssertions.assertSoftly(s -> { - // for making the test failure more obvious: - (list).forEach(v -> s.assertThat(v).isInstanceOf(Integer.class)); - s.assertThat(list).containsExactly(0, 1); + SoftAssertions.assertSoftly(s -> { + + // for making the test failure more obvious: + s.assertThat(list).allMatch(it -> Integer.class.isInstance(it)); + s.assertThat(list).containsExactly(0, 1); + }); }); } @@ -442,6 +443,7 @@ public class QueryExecutionResultHandlerUnitTests { // DATACMNS-1430 CustomStreamableWrapper customStreamable(); + // DATACMNS-1482 List listOfInteger(); }