Skip to content

Commit 5408921

Browse files
committed
FINERACT-2421: Fix flaky test case
1 parent 0ed6b7f commit 5408921

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

integration-tests/src/test/java/org/apache/fineract/integrationtests/DelinquencyBucketsIntegrationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public void testCreateDelinquencyRanges() {
120120
assertNotNull(delinquencyRangeResponse01);
121121
assertNotNull(ranges);
122122
assertFalse(ranges.isEmpty());
123-
DelinquencyRangeData range = ranges.get(ranges.size() - 1);
123+
DelinquencyRangeData range = ranges.stream().filter(r -> r.getId().equals(delinquencyRangeResponse01.getResourceId())).findFirst()
124+
.orElseThrow(() -> new AssertionError("Range with id " + delinquencyRangeResponse01.getResourceId() + " not found"));
124125
assertEquals(1, range.getMinimumAgeDays(), "Expected Min Age Days to 1");
125126
assertEquals(3, range.getMaximumAgeDays(), "Expected Max Age Days to 3");
126127
}

0 commit comments

Comments
 (0)