aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-07-13 09:55:09 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-07-13 09:55:43 +0200
commit8c91496b305856b080e35c6818f4dfc2ee9aeb53 (patch)
treee2d74bd3896f9898a99e6af66344a9b5acb459a3 /server/sonar-db-dao
parent76ea4fe342319874dc4809342911fdec3ee46c16 (diff)
downloadsonarqube-8c91496b305856b080e35c6818f4dfc2ee9aeb53.tar.gz
sonarqube-8c91496b305856b080e35c6818f4dfc2ee9aeb53.zip
fix unstable test in RuleDaoTest
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java4
1 files 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();