ccosp / open-o

GNU General Public License v2.0
2 stars 1 forks source link

Add parent ASOS-215 Test Failure Due to Inconsistent List Order in "testFindByClientIdAndVacancyId" #123

Open kateyang1998 opened 1 week ago

kateyang1998 commented 1 week ago

The testFindByClientIdAndVacancyId method in VacancyClientMatchDaoTest intermittently fails due to inconsistent order of elements in the expectedResult and result lists, despite both lists containing identical elements.

Steps to Reproduce:

  1. Run the testFindByClientIdAndVacancyId test multiple times.
  2. Observe that the test passes or fails depending on the order of elements in the lists.

Observed Behaviour: The test fails when the order of elements in the expectedResult list does not match the order of elements in the result list, even though both lists contain the same elements.

Expected Behaviour: The test should pass consistently, irrespective of the order of elements in the lists.

Suggested Solution:

  1. Sort the expected result and result lists before comparing them.
  2. Alternatively, compare the lists without considering the order by converting them to sets.