Print actual elements in GraphQlTester
See gh-507
This commit is contained in:
@@ -563,9 +563,11 @@ final class DefaultGraphQlTester implements GraphQlTester {
|
||||
public EntityList<E> containsExactly(E... values) {
|
||||
doAssert(() -> {
|
||||
List<E> expected = Arrays.asList(values);
|
||||
List<E> actual = getEntity();
|
||||
AssertionErrors.assertTrue(
|
||||
"List at path '" + getPath() + "' should have contained exactly " + expected,
|
||||
getEntity().equals(expected));
|
||||
"List at path '" + getPath() + "' should have contained exactly " + expected + ", " +
|
||||
"but did contain " + actual,
|
||||
actual.equals(expected));
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,8 @@ public class GraphQlTesterTests extends GraphQlTesterTestSupport {
|
||||
|
||||
assertThatThrownBy(() -> entityList.containsExactly(leia, han))
|
||||
.as("Should be exactly the same order")
|
||||
.hasMessageStartingWith("List at path 'me.friends' should have contained exactly");
|
||||
.hasMessageStartingWith("List at path 'me.friends' should have contained exactly")
|
||||
.hasMessageContaining("but did contain ");
|
||||
|
||||
response.path("me.friends")
|
||||
.entityList(new ParameterizedTypeReference<MovieCharacter>() {})
|
||||
|
||||
Reference in New Issue
Block a user