use of org.sonar.ce.task.projectanalysis.view.TriggerViewRefreshDelegate in project sonarqube by SonarSource.
the class TriggerViewRefreshStep method execute.
@Override
public void execute(ComputationStep.Context context) {
for (TriggerViewRefreshDelegate triggerViewRefreshDelegate : this.triggerViewRefreshDelegates) {
OptionalInt count = triggerViewRefreshDelegate.triggerFrom(analysisMetadata.getProject());
count.ifPresent(i -> context.getStatistics().add("refreshes" + triggerViewRefreshDelegate.getQualifier(), i));
}
}
use of org.sonar.ce.task.projectanalysis.view.TriggerViewRefreshDelegate in project sonarqube by SonarSource.
the class TriggerViewRefreshStepTest method execute_calls_delegate_with_project_from_holder_if_passed_to_constructor.
@Test
public void execute_calls_delegate_with_project_from_holder_if_passed_to_constructor() {
TriggerViewRefreshDelegate delegate = mock(TriggerViewRefreshDelegate.class);
Project project = mock(Project.class);
when(analysisMetadataHolder.getProject()).thenReturn(project);
TriggerViewRefreshStep underTest = new TriggerViewRefreshStep(analysisMetadataHolder, new TriggerViewRefreshDelegate[] { delegate });
underTest.execute(new TestComputationStepContext());
verify(analysisMetadataHolder).getProject();
verify(delegate).triggerFrom(project);
}
Aggregations