@Override
    public AnalyticsPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
        Capabilities capabilities = capabilities(descriptor.id());

        PluggableInstanceSettings pluginSettingsAndView = getPluginSettingsAndView(descriptor, extension);
        Image image = image(descriptor.id());

        return new AnalyticsPluginInfo(descriptor, image, capabilities, pluginSettingsAndView);
    }
@Test
    public void shouldBuildPluginInfoWithPluginSettingsConfiguration() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();
        PluginSettingsConfiguration value = new PluginSettingsConfiguration();
        value.add(new PluginSettingsProperty("username", null).with(Property.REQUIRED, true).with(Property.SECURE, false));
        value.add(new PluginSettingsProperty("password", null).with(Property.REQUIRED, true).with(Property.SECURE, true));

        when(extension.getPluginSettingsConfiguration("plugin1")).thenReturn(value);
        when(extension.getPluginSettingsView("plugin1")).thenReturn("some-html");

        AnalyticsPluginInfo pluginInfo = new AnalyticsPluginInfoBuilder(extension).pluginInfoFor(descriptor);

        List<PluginConfiguration> pluginConfigurations = List.of(
                new PluginConfiguration("username", new Metadata(true, false)),
                new PluginConfiguration("password", new Metadata(true, true))
        );
        PluginView pluginView = new PluginView("some-html");

        assertThat(pluginInfo.getDescriptor(), is(descriptor));
        assertThat(pluginInfo.getExtensionName(), is("analytics"));
        assertThat(pluginInfo.getPluginSettings(), is(new PluggableInstanceSettings(pluginConfigurations, pluginView)));
    }