use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class NotificationViewModelBuilderTest method shouldBeAbleToFetchAPluginInfoForAGivenId.
@Test
public void shouldBeAbleToFetchAPluginInfoForAGivenId() {
HashSet<String> pluginIds = new HashSet<>(Arrays.asList("email.notifier", "slack.notifier"));
when(registry.getNotificationPlugins()).thenReturn(pluginIds);
when(manager.getPluginDescriptorFor("email.notifier")).thenReturn(emailNotifier);
PluginInfo pluginInfo = builder.pluginInfoFor("email.notifier");
assertThat(pluginInfo.getId(), is("email.notifier"));
assertThat(pluginInfo.getType(), is("notification"));
assertThat(pluginInfo.getName(), is(emailNotifier.about().name()));
assertThat(pluginInfo.getVersion(), is(emailNotifier.about().version()));
assertNull(pluginInfo.getPluggableInstanceSettings());
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PackageViewModelBuilderTest method shouldBeAbleToFetchAllPluginInfos.
@Test
public void shouldBeAbleToFetchAllPluginInfos() {
when(manager.getPluginDescriptorFor("yum.poller")).thenReturn(yumPoller);
when(manager.getPluginDescriptorFor("npm.poller")).thenReturn(npmPoller);
List<PluginInfo> pluginInfos = builder.allPluginInfos();
assertThat(pluginInfos.size(), is(2));
PluginInfo pluginInfo = pluginInfos.get(0).getId() == "yum.poller" ? pluginInfos.get(0) : pluginInfos.get(1);
assertThat(pluginInfo.getId(), is("yum.poller"));
assertThat(pluginInfo.getType(), is("package-repository"));
assertThat(pluginInfo.getName(), is(yumPoller.about().name()));
assertThat(pluginInfo.getVersion(), is(yumPoller.about().version()));
assertNull(pluginInfo.getPluggableInstanceSettings());
}
Aggregations