@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 shouldBuildPluginInfoWithCapabilities() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();
        Capabilities capabilities = new Capabilities(Collections.emptyList());

        when(extension.getCapabilities(descriptor.id())).thenReturn(capabilities);

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

        assertThat(pluginInfo.getCapabilities(), is(capabilities));
    }