use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.
the class XooPostJobTest method increaseCoverage.
@Test
public void increaseCoverage() {
new XooPostJob().describe(new DefaultPostJobDescriptor());
PostJobContext context = mock(PostJobContext.class);
when(context.issues()).thenReturn(Arrays.<PostJobIssue>asList());
when(context.resolvedIssues()).thenReturn(Arrays.<PostJobIssue>asList());
new XooPostJob().execute(context);
assertThat(logTester.logs()).contains("Resolved issues: 0", "Open issues: 0");
}
use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.
the class PostJobOptimizerTest method should_run_analyzer_with_no_metadata.
@Test
public void should_run_analyzer_with_no_metadata() {
DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor();
assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
use of org.sonar.api.batch.postjob.internal.DefaultPostJobDescriptor in project sonarqube by SonarSource.
the class PostJobOptimizerTest method should_optimize_on_settings.
@Test
public void should_optimize_on_settings() {
DefaultPostJobDescriptor descriptor = new DefaultPostJobDescriptor().requireProperty("sonar.foo.reportPath");
assertThat(optimizer.shouldExecute(descriptor)).isFalse();
settings.setProperty("sonar.foo.reportPath", "foo");
assertThat(optimizer.shouldExecute(descriptor)).isTrue();
}
Aggregations