Skip to content

Commit

Permalink
Fix ITs
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel committed Nov 18, 2024
1 parent cce580b commit 9e26838
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion its/tests/src/test/java/its/FileExclusionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void should_respect_exclusion_settings_on_SQ() {
var filePath = Path.of("src/main/java/foo/Foo.java");
var clientFileDto = new ClientFileDto(filePath.toUri(), filePath, configScopeId, null, StandardCharsets.UTF_8.name(),
filePath.toAbsolutePath(), null, null, true);
var didUpdateFileSystemParams = new DidUpdateFileSystemParams(List.of(), List.of(clientFileDto));
var didUpdateFileSystemParams = new DidUpdateFileSystemParams(List.of(clientFileDto), List.of(), List.of());
backend.getFileService().didUpdateFileSystem(didUpdateFileSystemParams);

// Firstly check file is included
Expand Down
7 changes: 5 additions & 2 deletions its/tests/src/test/java/its/SonarCloudTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,11 @@ public void log(LogParams params) {
private static List<RawIssueDto> analyze(String projectKey, String fileName, String configScopeId, String ... properties) {
final var baseDir = Paths.get("projects/" + projectKey).toAbsolutePath();
final var filePath = baseDir.resolve(fileName);
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(List.of(),
List.of(new ClientFileDto(filePath.toUri(), Path.of(fileName), configScopeId, false, null, filePath, null, null, true))));
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(
List.of(new ClientFileDto(filePath.toUri(), Path.of(fileName), configScopeId, false, null, filePath, null, null, true)),
List.of(),
List.of()
));

var analyzeResponse = backend.getAnalysisService().analyzeFiles(
new AnalyzeFilesParams(configScopeId, UUID.randomUUID(), List.of(filePath.toUri()), toMap(properties), System.currentTimeMillis())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,11 @@ private void analyzeProject(String projectDirName, String projectKey, String...
private List<RawIssueDto> analyzeFile(String configScopeId, String baseDir, String filePathStr, String... properties) {
var filePath = Path.of("projects").resolve(baseDir).resolve(filePathStr);
var fileUri = filePath.toUri();
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(List.of(),
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), configScopeId, false, null, filePath.toAbsolutePath(), null, null, true))));
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), configScopeId, false, null, filePath.toAbsolutePath(), null, null, true)),
List.of(),
List.of()
));

var analyzeResponse = backend.getAnalysisService().analyzeFiles(
new AnalyzeFilesParams(configScopeId, UUID.randomUUID(), List.of(fileUri), toMap(properties), System.currentTimeMillis())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@ private static void bindProject(String projectName, String projectKey) {
private List<RawIssueDto> analyzeFile(String projectDir, String filePathStr, String... properties) {
var filePath = Path.of("projects").resolve(projectDir).resolve(filePathStr);
var fileUri = filePath.toUri();
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(List.of(),
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), CONFIG_SCOPE_ID, false, null, filePath.toAbsolutePath(), null, null, true))));
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), CONFIG_SCOPE_ID, false, null, filePath.toAbsolutePath(), null, null, true)),
List.of(),
List.of()
));

var analyzeResponse = backend.getAnalysisService().analyzeFiles(
new AnalyzeFilesParams(CONFIG_SCOPE_ID, UUID.randomUUID(), List.of(fileUri), toMap(properties), System.currentTimeMillis())
Expand Down
7 changes: 5 additions & 2 deletions its/tests/src/test/java/its/StandaloneTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ public void log(LogParams params) {
private List<RawIssueDto> analyzeFile(String configScopeId, String baseDir, String filePathStr, String... properties) {
var filePath = Path.of("projects").resolve(baseDir).resolve(filePathStr);
var fileUri = filePath.toUri();
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(List.of(),
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), configScopeId, false, null, filePath.toAbsolutePath(), null, null, true))));
backend.getFileService().didUpdateFileSystem(new DidUpdateFileSystemParams(
List.of(new ClientFileDto(fileUri, Path.of(filePathStr), configScopeId, false, null, filePath.toAbsolutePath(), null, null, true)),
List.of(),
List.of()
));

var analyzeResponse = backend.getAnalysisService().analyzeFiles(
new AnalyzeFilesParams(configScopeId, UUID.randomUUID(), List.of(fileUri), toMap(properties), System.currentTimeMillis())
Expand Down

0 comments on commit 9e26838

Please sign in to comment.