@Override
  public Map<String, ScannerPlugin> installRequiredPlugins() {
    LOG.info("Loading required plugins");
    InstallResult result = installPlugins(p -> p.getRequiredForLanguages() == null || p.getRequiredForLanguages().isEmpty());

    LOG.debug("Plugins not loaded because they are optional: {}", result.skippedPlugins);

    return result.installedPluginsByKey;
  }
@Test
  public void fail_if_plugin_not_found_two_times() throws IOException {
    WsTestUtil.mockReader(wsClient, "api/plugins/installed",
      new InputStreamReader(getClass().getResourceAsStream("ScannerPluginInstallerTest/blue-installed.json")),
      new InputStreamReader(getClass().getResourceAsStream("ScannerPluginInstallerTest/green-installed.json")));
    enqueueDownload("scmgit", "abc");
    enqueueDownload("cobol", "ghi");
    enqueueNotFoundDownload("java", "def");

    assertThatThrownBy(() -> underTest.installRequiredPlugins())
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Fail to download plugin [java]. Not found.");
  }