@Test
public void shouldFetchSCMMetadataForPluginsWhichImplementSCMExtensionPoint() {
SCMPropertyConfiguration scmPropertyConfiguration = new SCMPropertyConfiguration();
scmPropertyConfiguration.add(new SCMProperty("k1").with(SCMProperty.REQUIRED, true).with(SCMProperty.PART_OF_IDENTITY, false));
when(scmExtension.getSCMConfiguration(pluginDescriptor.id())).thenReturn(scmPropertyConfiguration);
when(scmExtension.getSCMView(pluginDescriptor.id())).thenReturn(createSCMView("display-value", "template"));
metadataLoader.fetchSCMMetaData(pluginDescriptor);
SCMConfigurations configurationMetadata = SCMMetadataStore.getInstance().getConfigurationMetadata(pluginDescriptor.id());
assertThat(configurationMetadata.size(), is(1));
SCMConfiguration scmConfiguration = configurationMetadata.get("k1");
assertThat(scmConfiguration.getKey(), is("k1"));
assertThat(scmConfiguration.getOption(SCMProperty.REQUIRED), is(true));
assertThat(scmConfiguration.getOption(SCMProperty.PART_OF_IDENTITY), is(false));
SCMView viewMetadata = SCMMetadataStore.getInstance().getViewMetadata(pluginDescriptor.id());
assertThat(viewMetadata.displayValue(), is("display-value"));
assertThat(viewMetadata.template(), is("template"));
}