@@ -540,7 +540,8 @@ private DefaultEntityList(List<E> entity, String path, ResponseDelegate delegate
540540 public EntityList <E > contains (E ... values ) {
541541 doAssert (() -> {
542542 List <E > expected = Arrays .asList (values );
543- AssertionErrors .assertTrue ("List at path '" + getPath () + "' does not contain " + expected ,
543+ AssertionErrors .assertTrue (
544+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to contain " + expected ,
544545 getEntity ().containsAll (expected ));
545546 });
546547 return this ;
@@ -552,7 +553,7 @@ public EntityList<E> doesNotContain(E... values) {
552553 doAssert (() -> {
553554 List <E > expected = Arrays .asList (values );
554555 AssertionErrors .assertTrue (
555- "List at path '" + getPath () + "' should not have contained " + expected ,
556+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to not contain " + expected ,
556557 !getEntity ().containsAll (expected ));
557558 });
558559 return this ;
@@ -563,34 +564,33 @@ public EntityList<E> doesNotContain(E... values) {
563564 public EntityList <E > containsExactly (E ... values ) {
564565 doAssert (() -> {
565566 List <E > expected = Arrays .asList (values );
566- List <E > actual = getEntity ();
567567 AssertionErrors .assertTrue (
568- "List at path '" + getPath () + "' should have contained exactly " + expected + ", " +
569- "but did contain " + actual ,
570- actual .equals (expected ));
568+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to contain exactly " + expected ,
569+ getEntity ().equals (expected ));
571570 });
572571 return this ;
573572 }
574573
575574 @ Override
576575 public EntityList <E > hasSize (int size ) {
577- doAssert (() -> AssertionErrors .assertTrue ("List at path '" + getPath () + "' should have size " + size ,
576+ doAssert (() -> AssertionErrors .assertTrue (
577+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to have size == " + size ,
578578 getEntity ().size () == size ));
579579 return this ;
580580 }
581581
582582 @ Override
583583 public EntityList <E > hasSizeLessThan (int size ) {
584584 doAssert (() -> AssertionErrors .assertTrue (
585- "List at path '" + getPath () + "' should have size less than " + size ,
585+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to have size < " + size ,
586586 getEntity ().size () < size ));
587587 return this ;
588588 }
589589
590590 @ Override
591591 public EntityList <E > hasSizeGreaterThan (int size ) {
592592 doAssert (() -> AssertionErrors .assertTrue (
593- "List at path '" + getPath () + "' should have size greater than " + size ,
593+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to have size > " + size ,
594594 getEntity ().size () > size ));
595595 return this ;
596596 }
0 commit comments