diff options
author | Lukasz Jarocki <lukasz.jarocki@sonarsource.com> | 2021-09-13 09:25:25 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-09-15 20:03:23 +0000 |
commit | 6bd76772723fdc500cc5f080861fde0897cbca54 (patch) | |
tree | d668baaa6cea675ae18e422f1175b04a27b2e424 /sonar-scanner-engine | |
parent | 168e65d3e743a2bebb0f4ac496942e217501b1bb (diff) | |
download | sonarqube-6bd76772723fdc500cc5f080861fde0897cbca54.tar.gz sonarqube-6bd76772723fdc500cc5f080861fde0897cbca54.zip |
SONAR-15349 unit tests
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/AbstractSettingsLoaderTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/AbstractSettingsLoaderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/AbstractSettingsLoaderTest.java index b7b94871a57..68e408c3a8a 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/AbstractSettingsLoaderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/settings/AbstractSettingsLoaderTest.java @@ -19,6 +19,7 @@ */ package org.sonar.scanner.repository.settings; +import java.util.List; import org.junit.Test; import org.sonarqube.ws.Settings.FieldValues; import org.sonarqube.ws.Settings.FieldValues.Value; @@ -28,8 +29,8 @@ import org.sonarqube.ws.Settings.Values; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.entry; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; public class AbstractSettingsLoaderTest { @@ -51,8 +52,11 @@ public class AbstractSettingsLoaderTest { @Test public void should_throw_exception_when_no_value_of_non_secured_settings() { - assertThatThrownBy(() -> AbstractSettingsLoader.toMap(singletonList(Setting.newBuilder() - .setKey("sonar.open.setting").build()))) + Setting setting = Setting.newBuilder().setKey("sonar.open.setting").build(); + + List<Setting> singletonList = singletonList(setting); + + assertThatThrownBy(() -> AbstractSettingsLoader.toMap(singletonList)) .isInstanceOf(IllegalStateException.class) .hasMessage("Unknown property value for sonar.open.setting"); } |