]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7330 Fix IssueServiceMediumTest
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 25 Feb 2016 11:20:52 +0000 (12:20 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 29 Feb 2016 12:26:54 +0000 (13:26 +0100)
server/sonar-server/src/test/java/org/sonar/server/issue/IssueServiceMediumTest.java

index 4544480729ca23910f16774bb881fbce14f5ff86..2658a61b4279402d6ea255c69b2d4a9d6358672d 100644 (file)
@@ -65,6 +65,7 @@ import org.sonar.server.issue.index.IssueIndexer;
 import org.sonar.server.permission.PermissionChange;
 import org.sonar.server.permission.PermissionUpdater;
 import org.sonar.server.rule.db.RuleDao;
+import org.sonar.server.rule.index.RuleIndexer;
 import org.sonar.server.tester.ServerTester;
 import org.sonar.server.tester.UserSessionRule;
 import org.sonar.server.user.NewUser;
@@ -86,6 +87,7 @@ public class IssueServiceMediumTest {
   IssueIndex IssueIndex;
   DbSession session;
   IssueService service;
+  RuleIndexer ruleIndexer;
 
   @Before
   public void setUp() {
@@ -94,6 +96,8 @@ public class IssueServiceMediumTest {
     IssueIndex = tester.get(IssueIndex.class);
     session = db.openSession(false);
     service = tester.get(IssueService.class);
+    ruleIndexer = tester.get(RuleIndexer.class);
+    ruleIndexer.setEnabled(true);
   }
 
   @After
@@ -573,6 +577,7 @@ public class IssueServiceMediumTest {
     RuleDto rule = RuleTesting.newXooX1();
     tester.get(RuleDao.class).insert(session, rule);
     session.commit();
+    ruleIndexer.index();
     return rule;
   }