use of org.sonar.batch.bootstrapper.IssueListener in project sonarqube by SonarSource.
the class DefaultIssueCallbackTest method testWithListener.
@Test
public void testWithListener() {
final List<IssueListener.Issue> issueList = new LinkedList<>();
IssueListener listener = new IssueListener() {
@Override
public void handle(Issue issue) {
issueList.add(issue);
}
};
DefaultIssueCallback issueCallback = new DefaultIssueCallback(issueCache, listener, userRepository, rules);
issueCallback.execute();
assertThat(issueList).hasSize(1);
Issue callbackIssue = issueList.get(0);
assertThat(callbackIssue.getAssigneeName()).isEqualTo("name");
assertThat(callbackIssue.getRuleName()).isEqualTo("rule name");
}
use of org.sonar.batch.bootstrapper.IssueListener in project sonarqube by SonarSource.
the class DefaultIssueCallbackTest method testDecorationNotFound.
@Test
public void testDecorationNotFound() {
final List<IssueListener.Issue> issueList = new LinkedList<>();
IssueListener listener = new IssueListener() {
@Override
public void handle(Issue issue) {
issueList.add(issue);
}
};
when(userRepository.load(any(String.class))).thenReturn(null);
when(rules.find(any(RuleKey.class))).thenReturn(null);
DefaultIssueCallback issueCallback = new DefaultIssueCallback(issueCache, listener, userRepository, rules);
issueCallback.execute();
}
use of org.sonar.batch.bootstrapper.IssueListener in project sonarqube by SonarSource.
the class DefaultIssueCallbackTest method testWithNulls.
@Test
public void testWithNulls() {
final List<IssueListener.Issue> issueList = new LinkedList<>();
IssueListener listener = new IssueListener() {
@Override
public void handle(Issue issue) {
issueList.add(issue);
}
};
issue.setKey(null);
issue.setAssignee(null);
DefaultIssueCallback issueCallback = new DefaultIssueCallback(issueCache, listener, userRepository, rules);
issueCallback.execute();
}
Aggregations