use of org.sonarlint.intellij.ui.nodes.IssueNode in project sonarlint-intellij by SonarSource.
the class IssueTreeModelBuilderTest method testNavigation.
@Test
public void testNavigation() {
Map<VirtualFile, Collection<LiveIssue>> data = new HashMap<>();
// ordering of files: name
// ordering of issues: creation date (inverse), getSeverity, setRuleName, startLine
addFile(data, "file1", 2);
addFile(data, "file2", 2);
addFile(data, "file3", 2);
treeBuilder.updateModel(data, "empty");
IssueNode first = treeBuilder.getNextIssue((AbstractNode<?>) model.getRoot());
assertNode(first, "file1", 1);
IssueNode second = treeBuilder.getNextIssue(first);
assertNode(second, "file1", 0);
IssueNode third = treeBuilder.getNextIssue(second);
assertNode(third, "file2", 1);
assertThat(treeBuilder.getPreviousIssue(third)).isEqualTo(second);
assertThat(treeBuilder.getPreviousIssue(second)).isEqualTo(first);
assertThat(treeBuilder.getPreviousIssue(first)).isNull();
}
Aggregations