]> source.dussan.org Git - sonarqube.git/commitdiff
Fix test when test env declares some system properties starting with "sonar."
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 7 Aug 2014 07:41:40 +0000 (09:41 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 7 Aug 2014 07:41:40 +0000 (09:41 +0200)
sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java

index d7eb444e59b1276cd4d76789b3f59f6c075bc21d..bc40a48acc8126820e025567bc3a0057a1e06847 100644 (file)
@@ -36,7 +36,10 @@ public class CommandLineParserTest {
     System.setProperty("sonar.CommandLineParserTest.used", "used");
 
     Properties p = parser.parseArguments(new String[] {"-Dsonar.foo=bar"});
-    assertThat(p).hasSize(2);
+
+    // test environment can already declare some system properties prefixed by "sonar."
+    // so we can't test the exact number "2"
+    assertThat(p.size()).isGreaterThanOrEqualTo(2);
     assertThat(p.getProperty("sonar.foo")).isEqualTo("bar");
     assertThat(p.getProperty("sonar.CommandLineParserTest.used")).isEqualTo("used");