]> source.dussan.org Git - sonarqube.git/commitdiff
Fix SonarQube version to use in PluginsTest
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 18 Jul 2016 12:07:16 +0000 (14:07 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 18 Jul 2016 13:52:31 +0000 (15:52 +0200)
it/it-tests/src/test/java/it/plugins/PluginsTest.java

index 3f6e038b64ded7ae8bc6144b07b7746ed907b49e..e819b338f381b3eae35ff4e905016c18f86b8656 100644 (file)
@@ -51,6 +51,7 @@ import org.junit.Test;
 import org.junit.rules.ErrorCollector;
 import org.sonar.updatecenter.common.Plugin;
 import org.sonar.updatecenter.common.Release;
+import org.sonar.updatecenter.common.Version;
 
 import static org.assertj.core.api.Assertions.fail;
 
@@ -97,10 +98,11 @@ public class PluginsTest {
 
     // install latest compatible releases of plugins
     org.sonar.updatecenter.common.Version sonarVersion = org.sonar.updatecenter.common.Version.create(builder.getSonarVersion());
-    builder.getUpdateCenter().setInstalledSonarVersion(sonarVersion);
+    Version sonarVersionWithoutPatch = Version.create(sonarVersion.getMajor() + "." + sonarVersion.getMinor());
+    builder.getUpdateCenter().setInstalledSonarVersion(sonarVersionWithoutPatch);
     for (Plugin plugin : builder.getUpdateCenter().findAllCompatiblePlugins()) {
       if (!DISABLED_PLUGINS.contains(plugin.getKey())) {
-        Release release = plugin.getLastCompatibleRelease(sonarVersion);
+        Release release = plugin.getLastCompatibleRelease(sonarVersionWithoutPatch);
         if (release != null) {
           builder.setOrchestratorProperty(plugin.getKey() + "Version", release.getVersion().toString());
           builder.addPlugin(plugin.getKey());