@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 shouldNotHaveRoleSettingsInPluginInfoIfPluginCannotAuthorize() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();
        Capabilities capabilities = new Capabilities(SupportedAuthType.Password, true, false, false);

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

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

        assertNull(pluginInfo.getRoleSettings());
    }