@Override
  public void execute(ComputationStep.Context context) {
    // no notification on pull requests as there is no real Quality Gate on those
    if (analysisMetadataHolder.isPullRequest()) {
      return;
    }
    executeForProject(treeRootHolder.getRoot());
  }
@Test
  public void verify_branch_name_is_not_set_in_notification_when_main() {
    analysisMetadataHolder.setBranch(new DefaultBranchImpl(DEFAULT_MAIN_BRANCH_NAME));

    when(measureRepository.getRawMeasure(PROJECT_COMPONENT, alertStatusMetric))
      .thenReturn(of(Measure.newMeasureBuilder().setQualityGateStatus(OK_QUALITY_GATE_STATUS).createNoValue()));
    when(measureRepository.getBaseMeasure(PROJECT_COMPONENT, alertStatusMetric)).thenReturn(
      of(Measure.newMeasureBuilder().setQualityGateStatus(new QualityGateStatus(ERROR)).createNoValue()));

    underTest.execute(new TestComputationStepContext());

    verify(notificationService).deliver(notificationArgumentCaptor.capture());
    Notification notification = notificationArgumentCaptor.getValue();
    assertThat(notification.getType()).isEqualTo("alerts");
    assertThat(notification.getFieldValue("projectKey")).isEqualTo(PROJECT_COMPONENT.getKey());
    assertThat(notification.getFieldValue("projectName")).isEqualTo(PROJECT_COMPONENT.getName());
    assertThat(notification.getFieldValue("projectVersion")).isEqualTo(PROJECT_COMPONENT.getProjectAttributes().getProjectVersion());
    assertThat(notification.getFieldValue("branch")).isNull();

    reset(measureRepository, eventRepository, notificationService);
  }