use of org.sonar.java.se.JavaCheckVerifier in project sonar-java by SonarSource.
the class FlowComputationTest method test_flows_with_single_msg_not_reported.
@Test
public void test_flows_with_single_msg_not_reported() throws Exception {
JavaCheckVerifier noFlowsVerifier = new JavaCheckVerifier() {
@Override
protected void checkIssues(Set<AnalyzerMessage> issues) {
assertThat(issues).hasSize(4);
issues.forEach(issue -> assertThat(issue.flows.stream().allMatch(List::isEmpty)).as("No flows expected, but %s was reported.", issue.flows).isTrue());
}
};
noFlowsVerifier.scanFile("src/test/files/se/FlowsWithSingleMsg.java", new SECheck[] { new NullDereferenceCheck(), new ConditionalUnreachableCodeCheck(), new BooleanGratuitousExpressionsCheck(), new DivisionByZeroCheck() });
}
Aggregations