@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_json_of_installed_plugins_is_not_valid() {
    WsTestUtil.mockReader(wsClient, "api/plugins/installed", new StringReader("not json"));

    assertThatThrownBy(() -> underTest.installRequiredPlugins())
      .isInstanceOf(IllegalStateException.class)
      .hasMessage("Fail to parse response of api/plugins/installed");
  }