I run test cases by putting @Ignore in every test cases individually. Like you said testIncludeIsolatedParameter()
unit test occurred previous mentioned error many times. But when i ignore that method and run the test cases , sometimes
getAttachments_shouldReturnAllAttachments() , getAttachments_shouldNotReturnIsolatedAttachments() , getAttachments_shouldReturnIsolatedAttachments() tests also give the same error ( ration of occurring is 1 for 10 times.) I used mvn test -Dtest=AttachmentsServiceTest -pl api-2.0/ for testings.
And for overcome this error can i used this method ,
use Collections.sort(expectedAttachments, Comparator.comparing(Attachment::getUuid)); which will sort the expectedAttachments list based on the Uuid of attachements.( i didn’t able to get getDateCreated() for sorting because it return null vlaues ). And aslo sort the actualAttachments list using same method and used the Assert.assertArrayEquals method for both sorted lists.