Skip to content

Commit

Permalink
Use hamcrest for asserting order on expectation.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekrb19 committed Jun 3, 2024
1 parent da73aa6 commit d2d1c2d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;

public class SegmentLocalCacheManagerTest
{
Expand Down Expand Up @@ -207,7 +211,7 @@ public void testGetCachedSegments() throws IOException
manager.storeInfoFile(segment2);

Assert.assertTrue(manager.canHandleSegments());
Assert.assertEquals(ImmutableList.of(segment2, segment1), manager.getCachedSegments());
assertThat(manager.getCachedSegments(), containsInAnyOrder(segment1, segment2));
}

@Test
Expand Down Expand Up @@ -255,7 +259,7 @@ public void testGetCachedSegmentsWithMissingSegmentFile() throws IOException
Assert.assertTrue(segment3InfoFile.exists());

Assert.assertTrue(manager.canHandleSegments());
Assert.assertEquals(ImmutableList.of(segment2, segment1), manager.getCachedSegments());
assertThat(manager.getCachedSegments(), containsInAnyOrder(segment1, segment2));
Assert.assertFalse(segment3InfoFile.exists());
}

Expand Down

0 comments on commit d2d1c2d

Please sign in to comment.