use of org.sonar.scanner.protocol.input.ScannerInput.ServerIssue in project sonarlint-core by SonarSource.
the class PartialUpdaterTest method update_file_issues_by_module.
@Test
public void update_file_issues_by_module() throws IOException {
ServerIssue issue = ServerIssue.newBuilder().setKey("issue1").build();
List<ServerIssue> issues = Collections.singletonList(issue);
String moduleKey = "dummy";
when(storagePaths.getServerIssuesPath(moduleKey)).thenReturn(temp.newFolder().toPath());
when(downloader.apply(moduleKey)).thenReturn(issues);
updater.updateFileIssues(moduleKey, new DefaultTempFolder(temp.newFolder()));
verify(issueStore).save(issues);
}
use of org.sonar.scanner.protocol.input.ScannerInput.ServerIssue in project sonarlint-core by SonarSource.
the class PartialUpdaterTest method update_file_issues.
@Test
public void update_file_issues() {
ServerIssue issue = ServerIssue.newBuilder().setKey("issue1").build();
List<ServerIssue> issues = Collections.singletonList(issue);
when(storagePaths.getServerIssuesPath("module")).thenReturn(temp.getRoot().toPath());
when(issueStoreReader.getFileKey("module", "file")).thenReturn("module:file");
when(downloader.apply("module:file")).thenReturn(issues);
updater.updateFileIssues("module", "file");
verify(issueStore).save(issues);
}
use of org.sonar.scanner.protocol.input.ScannerInput.ServerIssue in project sonarlint-core by SonarSource.
the class ServerIssueStoreTest method should_read_object_replaced.
@Test
public void should_read_object_replaced() throws IOException {
ServerIssueStore store = new ServerIssueStore(temporaryFolder.getRoot().toPath());
String path = "myfile";
String moduleKey = "module";
ServerIssue issue1 = ServerIssue.newBuilder().setPath(path).setModuleKey(moduleKey).setLine(11).build();
ServerIssue issue2 = ServerIssue.newBuilder().setPath(path).setModuleKey(moduleKey).setLine(22).build();
store.save(Collections.singletonList(issue1));
assertThat(store.load("module:myfile")).containsOnly(issue1);
store.save(Collections.singletonList(issue2));
assertThat(store.load("module:myfile")).containsOnly(issue2);
}
Aggregations