Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-70411

Add extra information to Assert.assertEquals when checking for size on collection/array/hits

    Details

      Description

      When we have a test that does an assert on two integers and one of those is the size/length of an array, collection or Hits, we should add more information so when the test fails, it's easier to figure out what's wrong.

      For Hits or Collections:

      instead of

      Assert.assertEquals(expectedSize, collection.size());
      

      we should do

      Assert.assertEquals(collection.toString(), expectedSize, collection.size());
      

      For Arrays:

      instead of

      Assert.assertEquals(expectedSize, array.length);
      

      we should do

      Assert.assertEquals(Arrays.toString(array), expectedSize, array.length);
      

        Attachments

          Activity

            People

            • Assignee:
              hugo.huijser Hugo Huijser
              Reporter:
              hugo.huijser Hugo Huijser
              Recent user:
              Csaba Turcsan
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.0.0 DXP FP11
                7.0.3 CE GA4
                Master