Search in sources :

Example 1 with EventRepository

use of org.sonar.ce.task.projectanalysis.event.EventRepository in project sonarqube by SonarSource.

the class QualityGateEventsStepTest method no_alert_on_pull_request_branches.

@Test
public void no_alert_on_pull_request_branches() {
    Branch pr = mock(Branch.class);
    when(pr.getType()).thenReturn(BranchType.PULL_REQUEST);
    analysisMetadataHolder.setBranch(pr);
    TreeRootHolder treeRootHolder = mock(TreeRootHolder.class);
    MetricRepository metricRepository = mock(MetricRepository.class);
    MeasureRepository measureRepository = mock(MeasureRepository.class);
    EventRepository eventRepository = mock(EventRepository.class);
    NotificationService notificationService = mock(NotificationService.class);
    QualityGateEventsStep underTest = new QualityGateEventsStep(treeRootHolder, metricRepository, measureRepository, eventRepository, notificationService, analysisMetadataHolder);
    underTest.execute(new TestComputationStepContext());
    verifyZeroInteractions(treeRootHolder, metricRepository, measureRepository, eventRepository, notificationService);
}
Also used : MeasureRepository(org.sonar.ce.task.projectanalysis.measure.MeasureRepository) MetricRepository(org.sonar.ce.task.projectanalysis.metric.MetricRepository) Branch(org.sonar.ce.task.projectanalysis.analysis.Branch) EventRepository(org.sonar.ce.task.projectanalysis.event.EventRepository) NotificationService(org.sonar.server.notification.NotificationService) TestComputationStepContext(org.sonar.ce.task.step.TestComputationStepContext) TreeRootHolder(org.sonar.ce.task.projectanalysis.component.TreeRootHolder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Branch (org.sonar.ce.task.projectanalysis.analysis.Branch)1 TreeRootHolder (org.sonar.ce.task.projectanalysis.component.TreeRootHolder)1 EventRepository (org.sonar.ce.task.projectanalysis.event.EventRepository)1 MeasureRepository (org.sonar.ce.task.projectanalysis.measure.MeasureRepository)1 MetricRepository (org.sonar.ce.task.projectanalysis.metric.MetricRepository)1 TestComputationStepContext (org.sonar.ce.task.step.TestComputationStepContext)1 NotificationService (org.sonar.server.notification.NotificationService)1