@Override
    public SCMPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
        SCMPropertyConfiguration scmConfiguration = extension.getSCMConfiguration(descriptor.id());
        SCMView scmView = extension.getSCMView(descriptor.id());
        PluggableInstanceSettings pluginSettingsAndView = getPluginSettingsAndView(descriptor, extension);
        if (scmConfiguration == null) {
            throw new RuntimeException(format("Plugin[%s] returned null scm configuration", descriptor.id()));
        }

        if (scmView == null) {
            throw new RuntimeException(format("Plugin[%s] returned null scm view", descriptor.id()));
        }

        PluggableInstanceSettings scmSettings = new PluggableInstanceSettings(scmPluginConfigurations(scmConfiguration), new PluginView(scmView.template()));
        return new SCMPluginInfo(descriptor, scmView.displayValue(), scmSettings, pluginSettingsAndView);
    }
@Test
    public void shouldThrowAnExceptionIfScmViewReturnedByPluginIsNull() {
        GoPluginDescriptor descriptor = GoPluginDescriptor.builder().id("plugin1").build();
        when(extension.getSCMView("plugin1")).thenReturn(null);
        assertThatThrownBy(() -> new SCMPluginInfoBuilder(extension).pluginInfoFor(descriptor))
                .hasMessage("Plugin[plugin1] returned null scm view");
    }