Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.sonarsource.sonarlint.ls.clientapi;

import java.net.Authenticator;
import java.net.URI;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -48,7 +49,7 @@ class SystemPropertiesAuthenticatorTest {
static void initializeTestVariables() throws Exception {
defaultAuthenticator = Authenticator.getDefault();
Authenticator.setDefault(new SystemPropertiesAuthenticator());
proxiedUrl = new URL("https://somehost.example.net");
proxiedUrl = new URI("https://somehost.example.net").toURL();
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.concurrent.ExecutionException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
Expand Down Expand Up @@ -52,7 +51,7 @@
private final String FILE_PYTHON = "myFile.py";

@BeforeEach
public void prepare() throws IOException, ExecutionException, InterruptedException {
public void prepare() throws IOException {

Check warning on line 54 in src/test/java/org/sonarsource/sonarlint/ls/commands/ShowAllLocationsCommandTests.java

View check run for this annotation

SonarQube-Next / SonarQube Code Analysis

Remove this 'public' modifier.

[S5786] JUnit5 test classes and methods should have default package visibility See more on https://next.sonarqube.com/sonarqube/project/issues?id=org.sonarsource.sonarlint.ls%3Asonarlint-language-server&pullRequest=709&issues=2254e362-3995-42f9-9290-7671d218824c&open=2254e362-3995-42f9-9290-7671d218824c
workspaceFolderPath = basedir.resolve("myWorkspaceFolder");
Files.createDirectories(workspaceFolderPath);
fileInAWorkspaceFolderPath = workspaceFolderPath.resolve(FILE_PYTHON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void should_provide_main_files_of_requested_suffix() {
var files = folderFileSystem.files("py", InputFile.Type.MAIN);

assertThat(files)
.extracting(ClientInputFile::getPath, FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
.extracting(c -> Path.of(c.uri()).toString(), FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
ClientInputFile::relativePath, ClientInputFile::uri)
.containsExactly(tuple(pythonFile.toAbsolutePath().toString(), "", false, StandardCharsets.UTF_8, pythonFile.toUri(), "file.py", pythonFile.toUri()));
}
Expand All @@ -85,9 +85,9 @@ void should_provide_test_files_of_requested_suffix() {
var files = folderFileSystem.files("py", InputFile.Type.TEST);

assertThat(files)
.extracting(ClientInputFile::getPath, FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
ClientInputFile::relativePath, ClientInputFile::uri)
.containsExactly(tuple(pythonFile.toAbsolutePath().toString(), "", true, StandardCharsets.UTF_8, pythonFile.toUri(), "file.py", pythonFile.toUri()));
.extracting(ClientInputFile::uri, FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
ClientInputFile::relativePath)
.containsExactly(tuple(pythonFile.toUri(), "", true, StandardCharsets.UTF_8, pythonFile.toUri(), "file.py"));
}

@Test
Expand All @@ -101,7 +101,7 @@ void should_provide_all_main_files() {
var files = folderFileSystem.files();

assertThat(files)
.extracting(ClientInputFile::getPath, FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
.extracting(c -> Path.of(c.uri()).toString(), FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
ClientInputFile::relativePath, ClientInputFile::uri)
.containsExactly(tuple(pythonFile.toAbsolutePath().toString(), "", false, StandardCharsets.UTF_8, pythonFile.toUri(), "file.py", pythonFile.toUri()));
}
Expand All @@ -117,7 +117,7 @@ void should_provide_all_test_files() {
var files = folderFileSystem.files();

assertThat(files)
.extracting(ClientInputFile::getPath, FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
.extracting(f -> Path.of(f.uri()).toString(), FolderFileSystemTests::getFileContents, ClientInputFile::isTest, ClientInputFile::getCharset, ClientInputFile::getClientObject,
ClientInputFile::relativePath, ClientInputFile::uri)
.containsExactly(tuple(pythonFile.toAbsolutePath().toString(), "", true, StandardCharsets.UTF_8, pythonFile.toUri(), "file.py", pythonFile.toUri()));
}
Expand Down
Loading