@Override
  public void execute(Context context) {
    executeForBranch(treeRootHolder.getRoot());
  }
@Test
  public void execute_whenAnalyzerChanged_shouldRaiseEventForAllLanguages() {
    QualityProfile qp1 = qp(QP_NAME_1, LANGUAGE_KEY_1, new Date());
    QualityProfile qp2 = qp(QP_NAME_2, LANGUAGE_KEY_2, new Date());

    mockLanguageInRepository(LANGUAGE_KEY_1);
    mockLanguageInRepository(LANGUAGE_KEY_2);

    when(measureRepository.getBaseMeasure(treeRootHolder.getRoot(), qualityProfileMetric)).thenReturn(Optional.of(newMeasure()));
    when(measureRepository.getRawMeasure(treeRootHolder.getRoot(), qualityProfileMetric)).thenReturn(Optional.of(newMeasure(qp1, qp2)));

    ScannerPlugin scannerPluginLanguage1 = mockScannerPlugin(LANGUAGE_KEY_1, 3L);
    ScannerPlugin scannerPluginLanguage2 = mockScannerPlugin(LANGUAGE_KEY_2, 2L);

    when(analysisMetadataHolder.getScannerPluginsByKey()).thenReturn(Map.of(LANGUAGE_KEY_1, scannerPluginLanguage1, LANGUAGE_KEY_2, scannerPluginLanguage2));
    when(analysisMetadataHolder.getBaseAnalysis()).thenReturn(new Analysis.Builder().setUuid("uuid").setCreatedAt(1L).build());

    underTest.execute(new TestComputationStepContext());

    verify(eventRepository, times(2)).add(eventArgumentCaptor.capture());
    verifyNoMoreInteractions(eventRepository);

    assertThat(eventArgumentCaptor.getAllValues())
      .extracting(Event::getCategory, Event::getName, Event::getDescription)
      .containsExactlyInAnyOrder(tuple(Event.Category.ISSUE_DETECTION, "Capabilities have been updated (language_key1_name)", null),
        tuple(Event.Category.ISSUE_DETECTION, "Capabilities have been updated (language_key2_name)", null));
  }