@Override
    public ElasticAgentPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
        String pluginId = descriptor.id();

        PluggableInstanceSettings pluggableInstanceSettings = null;
        if (!extension.supportsClusterProfiles(pluginId)) {
            pluggableInstanceSettings = getPluginSettingsAndView(descriptor, extension);
        }

        return new ElasticAgentPluginInfo(descriptor,
                elasticElasticAgentProfileSettings(pluginId),
                elasticClusterProfileSettings(pluginId),
                image(pluginId),
                pluggableInstanceSettings,
                capabilities(pluginId));
    }
@Test
    public void shouldNotFetchPluginSettingsForPluginsSupportingClusterProfiles() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();

        when(extension.supportsClusterProfiles("plugin1")).thenReturn(true);

        ElasticAgentPluginInfoBuilder builder = new ElasticAgentPluginInfoBuilder(extension);
        ElasticAgentPluginInfo pluginInfo = builder.pluginInfoFor(descriptor);

        assertNull(pluginInfo.getPluginSettings());

        verify(extension, never()).getPluginSettingsConfiguration(descriptor.id());
        verify(extension, never()).getPluginSettingsView(descriptor.id());
    }