Search in sources :

Example 1 with ComplexityMeasuresStep

use of org.sonar.ce.task.projectanalysis.step.ComplexityMeasuresStep in project sonarqube by SonarSource.

the class ProjectExportComputationStepsTest method instances_throws_ISE_if_container_does_not_have_second_step.

@Test
public void instances_throws_ISE_if_container_does_not_have_second_step() {
    ComplexityMeasuresStep reportExtractionStep = mock(ComplexityMeasuresStep.class);
    SpringComponentContainer componentContainer = new SpringComponentContainer() {

        {
            add(reportExtractionStep);
        }
    }.startComponents();
    TaskContainerImpl computeEngineContainer = new TaskContainerImpl(componentContainer, container -> {
    // do nothing
    });
    computeEngineContainer.startComponents();
    Iterable<ComputationStep> instances = new ProjectExportComputationSteps(computeEngineContainer).instances();
    assertThatThrownBy(() -> Lists.newArrayList(instances)).isInstanceOf(IllegalStateException.class).hasMessageContaining("class org.sonar.ce.task.projectexport.steps.LoadProjectStep");
}
Also used : SpringComponentContainer(org.sonar.core.platform.SpringComponentContainer) TaskContainerImpl(org.sonar.ce.task.container.TaskContainerImpl) ComputationStep(org.sonar.ce.task.step.ComputationStep) ComplexityMeasuresStep(org.sonar.ce.task.projectanalysis.step.ComplexityMeasuresStep) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TaskContainerImpl (org.sonar.ce.task.container.TaskContainerImpl)1 ComplexityMeasuresStep (org.sonar.ce.task.projectanalysis.step.ComplexityMeasuresStep)1 ComputationStep (org.sonar.ce.task.step.ComputationStep)1 SpringComponentContainer (org.sonar.core.platform.SpringComponentContainer)1