Search in sources :

Example 21 with SonarQubeServer

use of org.sonarlint.intellij.config.global.SonarQubeServer in project sonarlint-intellij by SonarSource.

the class SonarLintUtilsTest method testServerConfigurationPassword.

@Test
public void testServerConfigurationPassword() {
    SonarApplication app = mock(SonarApplication.class);
    when(app.getVersion()).thenReturn("1.0");
    super.register(ApplicationManager.getApplication(), SonarApplication.class, app);
    SonarQubeServer server = SonarQubeServer.newBuilder().setHostUrl("http://myhost").setLogin("token").setPassword("pass").build();
    ServerConfiguration config = SonarLintUtils.getServerConfiguration(server);
    assertThat(config.getLogin()).isEqualTo(server.getLogin());
    assertThat(config.getPassword()).isEqualTo(server.getPassword());
}
Also used : SonarApplication(org.sonarlint.intellij.SonarApplication) ServerConfiguration(org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration) SonarQubeServer(org.sonarlint.intellij.config.global.SonarQubeServer) SonarTest(org.sonarlint.intellij.SonarTest) Test(org.junit.Test)

Aggregations

SonarQubeServer (org.sonarlint.intellij.config.global.SonarQubeServer)21 Test (org.junit.Test)12 SonarTest (org.sonarlint.intellij.SonarTest)6 InvalidBindingException (org.sonarlint.intellij.exception.InvalidBindingException)6 ConnectedSonarLintEngine (org.sonarsource.sonarlint.core.client.api.connected.ConnectedSonarLintEngine)6 SonarApplication (org.sonarlint.intellij.SonarApplication)4 ServerConfiguration (org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration)4 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)3 Project (com.intellij.openapi.project.Project)3 LinkedList (java.util.LinkedList)3 List (java.util.List)3 SonarLintProjectSettings (org.sonarlint.intellij.config.project.SonarLintProjectSettings)3 SonarLintConsole (org.sonarlint.intellij.ui.SonarLintConsole)3 CommitStepException (com.intellij.ide.wizard.CommitStepException)2 FileUtil (com.intellij.openapi.util.io.FileUtil)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 Collections (java.util.Collections)2 Before (org.junit.Before)2