use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluggableTaskViewModelBuilder method allPluginInfos.
public List<PluginInfo> allPluginInfos() {
List<PluginInfo> pluginInfos = new ArrayList<>();
for (String pluginId : PluggableTaskConfigStore.store().pluginIds()) {
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
pluginInfos.add(new PluginInfo(descriptor, TaskExtension.TASK_EXTENSION, taskPreference.getView().displayValue(), null, null));
}
return pluginInfos;
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class SCMViewModelBuilder method allPluginInfos.
public List<PluginInfo> allPluginInfos() {
List<PluginInfo> pluginInfos = new ArrayList<>();
for (String pluginId : SCMMetadataStore.getInstance().pluginIds()) {
GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
SCMPreference scmPreference = SCMMetadataStore.getInstance().preferenceFor(pluginId);
pluginInfos.add(new PluginInfo(descriptor, SCMExtension.EXTENSION_NAME, scmPreference.getScmView().displayValue(), null, null));
}
return pluginInfos;
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluginServiceTest method shouldFetchPluginInfoForTheSpecifiedId.
@Test
public void shouldFetchPluginInfoForTheSpecifiedId() {
GoPluginDescriptor.About about = new GoPluginDescriptor.About("asdfasdf", "1.0", null, null, null, null);
PluginInfo pluginInfo = new PluginInfo(new GoPluginDescriptor("github.pr", "1.0", about, null, null, false), null, null, null, null);
when(builder.pluginInfoFor("github.pr")).thenReturn(pluginInfo);
assertThat(pluginService.pluginInfo("github.pr"), is(pluginInfo));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class SCMViewModelBuilderTest method shouldBeAbleToFetchAPluginInfoForAGivenIdWithConfigurations.
@Test
public void shouldBeAbleToFetchAPluginInfoForAGivenIdWithConfigurations() {
when(manager.getPluginDescriptorFor("github.pr")).thenReturn(githubPR);
PluginInfo pluginInfo = builder.pluginInfoFor("github.pr");
HashMap expectedMetadata = new HashMap<String, Object>() {
{
put("required", true);
put("secure", false);
put("part_of_identity", true);
}
};
List<PluginConfiguration> configurations = pluginInfo.getPluggableInstanceSettings().getConfigurations();
assertThat(configurations.size(), is(2));
PluginConfiguration configuration1 = configurations.get(0);
assertThat(configuration1.getKey(), is("key1"));
assertNull(configuration1.getType());
assertThat(configuration1.getMetadata(), Is.<Map<String, Object>>is(expectedMetadata));
PluginConfiguration configuration2 = configurations.get(1);
assertThat(configuration2.getKey(), is("key2"));
assertNull(configuration2.getType());
assertThat(configuration1.getMetadata(), Is.<Map<String, Object>>is(expectedMetadata));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluggableTaskViewModelBuilderTest method shouldBeAbleToFetchAPluginInfoForAGivenId.
@Test
public void shouldBeAbleToFetchAPluginInfoForAGivenId() {
when(manager.getPluginDescriptorFor("xunit.convertor")).thenReturn(xunitConvertor);
PluginInfo pluginInfo = builder.pluginInfoFor("xunit.convertor");
assertThat(pluginInfo.getId(), is("xunit.convertor"));
assertThat(pluginInfo.getType(), is("task"));
assertThat(pluginInfo.getName(), is(xunitConvertor.about().name()));
assertThat(pluginInfo.getDisplayName(), is("task display value"));
assertThat(pluginInfo.getVersion(), is(xunitConvertor.about().version()));
}
Aggregations