@@ -540,7 +540,8 @@ private DefaultEntityList(List<E> entity, String path, ResponseDelegate delegate
540
540
public EntityList <E > contains (E ... values ) {
541
541
doAssert (() -> {
542
542
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 ,
544
545
getEntity ().containsAll (expected ));
545
546
});
546
547
return this ;
@@ -552,7 +553,7 @@ public EntityList<E> doesNotContain(E... values) {
552
553
doAssert (() -> {
553
554
List <E > expected = Arrays .asList (values );
554
555
AssertionErrors .assertTrue (
555
- "List at path '" + getPath () + "' should not have contained " + expected ,
556
+ "Expecting list " + getEntity () + " at path '" + getPath () + "' to not contain " + expected ,
556
557
!getEntity ().containsAll (expected ));
557
558
});
558
559
return this ;
@@ -563,34 +564,33 @@ public EntityList<E> doesNotContain(E... values) {
563
564
public EntityList <E > containsExactly (E ... values ) {
564
565
doAssert (() -> {
565
566
List <E > expected = Arrays .asList (values );
566
- List <E > actual = getEntity ();
567
567
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 ));
571
570
});
572
571
return this ;
573
572
}
574
573
575
574
@ Override
576
575
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 ,
578
578
getEntity ().size () == size ));
579
579
return this ;
580
580
}
581
581
582
582
@ Override
583
583
public EntityList <E > hasSizeLessThan (int size ) {
584
584
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 ,
586
586
getEntity ().size () < size ));
587
587
return this ;
588
588
}
589
589
590
590
@ Override
591
591
public EntityList <E > hasSizeGreaterThan (int size ) {
592
592
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 ,
594
594
getEntity ().size () > size ));
595
595
return this ;
596
596
}
0 commit comments