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

        PluggableInstanceSettings authConfigSettings = authConfigSettings(descriptor.id());
        PluggableInstanceSettings roleSettings = roleSettings(descriptor.id(), capabilities);
        Image image = image(descriptor.id());

        return new AuthorizationPluginInfo(descriptor, authConfigSettings, roleSettings, image, capabilities);
    }
@Test
    public void shouldBuildPluginInfoWithRoleSettings() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();
        List<PluginConfiguration> pluginConfigurations = List.of(
                new PluginConfiguration("group", new Metadata(true, false)),
                new PluginConfiguration("something_secure", new Metadata(true, true))
        );

        when(extension.getRoleConfigurationMetadata(descriptor.id())).thenReturn(pluginConfigurations);
        when(extension.getRoleConfigurationView(descriptor.id())).thenReturn("role_config");

        AuthorizationPluginInfo pluginInfo = new AuthorizationPluginInfoBuilder(extension).pluginInfoFor(descriptor);

        assertThat(pluginInfo.getRoleSettings(), is(new PluggableInstanceSettings(pluginConfigurations, new PluginView("role_config"))));
    }