Search in sources :

Example 6 with WsHelperImpl

use of org.sonarsource.sonarlint.core.WsHelperImpl in project sonarlint-core by SonarSource.

the class ConnectedModeTest method generateToken.

@Test
public void generateToken() {
    WsHelper ws = new WsHelperImpl();
    ServerConfiguration serverConfig = getServerConfig(true);
    if (!ORCHESTRATOR.getServer().version().isGreaterThanOrEquals("5.4")) {
        exception.expect(UnsupportedServerException.class);
    }
    String token = ws.generateAuthenticationToken(serverConfig, "name", false);
    assertThat(token).isNotNull();
    token = ws.generateAuthenticationToken(serverConfig, "name", true);
    assertThat(token).isNotNull();
}
Also used : WsHelperImpl(org.sonarsource.sonarlint.core.WsHelperImpl) ServerConfiguration(org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration) WsHelper(org.sonarsource.sonarlint.core.client.api.connected.WsHelper) Test(org.junit.Test)

Aggregations

WsHelperImpl (org.sonarsource.sonarlint.core.WsHelperImpl)6 WsHelper (org.sonarsource.sonarlint.core.client.api.connected.WsHelper)5 Test (org.junit.Test)4 ServerConfiguration (org.sonarsource.sonarlint.core.client.api.connected.ServerConfiguration)3 UnsupportedServerException (org.sonarsource.sonarlint.core.client.api.exceptions.UnsupportedServerException)2 IOException (java.io.IOException)1 ExpectedException (org.junit.rules.ExpectedException)1 TaskProgressMonitor (org.sonarlint.intellij.util.TaskProgressMonitor)1 RemoteOrganization (org.sonarsource.sonarlint.core.client.api.connected.RemoteOrganization)1 ValidationResult (org.sonarsource.sonarlint.core.client.api.connected.ValidationResult)1