From 8c91496b305856b080e35c6818f4dfc2ee9aeb53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Thu, 13 Jul 2017 09:55:09 +0200 Subject: [PATCH] fix unstable test in RuleDaoTest --- .../src/test/java/org/sonar/db/rule/RuleDaoTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java index ad876007714..06ad5c92bf1 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java @@ -707,8 +707,8 @@ public class RuleDaoTest { underTest.scrollIndexingRulesByKeys(db.getSession(), Arrays.asList(r1.getKey(), r2.getKey()), accumulator); assertThat(accumulator.list).hasSize(2); - RuleForIndexingDto firstRule = accumulator.list.get(0); - RuleForIndexingDto secondRule = accumulator.list.get(1); + RuleForIndexingDto firstRule = accumulator.list.stream().filter(t -> t.getId().equals(r1.getId())).findFirst().get(); + RuleForIndexingDto secondRule = accumulator.list.stream().filter(t -> t.getId().equals(r2.getId())).findFirst().get(); assertRuleDefinitionFieldsAreEquals(r1, firstRule); assertThat(firstRule.getTemplateRuleKey()).isNull(); -- 2.39.5