use of com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo in project gocd by gocd.
the class NotificationPluginInfoBuilderTest method shouldContinueWithBuildingPluginInfoWhenPluginViewIsNotProvidedByPlugin.
@Test
public void shouldContinueWithBuildingPluginInfoWhenPluginViewIsNotProvidedByPlugin() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
stub(extension.getPluginSettingsView("plugin1")).toReturn(null);
NotificationPluginInfo pluginInfo = new NotificationPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getDescriptor(), is(descriptor));
assertThat(pluginInfo.getExtensionName(), is("notification"));
assertNull(pluginInfo.getPluginSettings());
}
use of com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo in project gocd by gocd.
the class NotificationPluginInfoBuilderTest method shouldContinueWithBuildingPluginInfoWhenPluginSettingsIsNotProvidedByPlugin.
@Test
public void shouldContinueWithBuildingPluginInfoWhenPluginSettingsIsNotProvidedByPlugin() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
stub(extension.getPluginSettingsConfiguration("plugin1")).toReturn(null);
NotificationPluginInfo pluginInfo = new NotificationPluginInfoBuilder(extension).pluginInfoFor(descriptor);
assertThat(pluginInfo.getDescriptor(), is(descriptor));
assertThat(pluginInfo.getExtensionName(), is("notification"));
assertNull(pluginInfo.getPluginSettings());
}
use of com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo in project gocd by gocd.
the class CombinedPluginInfoTest method shouldNotFindImageIfPluginDoesNotImplementAnExtensionWhichHasImages.
@Test
public void shouldNotFindImageIfPluginDoesNotImplementAnExtensionWhichHasImages() throws Exception {
NotificationPluginInfo notificationPluginInfo = new NotificationPluginInfo(null, null);
PluggableTaskPluginInfo pluggableTaskPluginInfo = new PluggableTaskPluginInfo(null, null, null);
assertThat(new CombinedPluginInfo(notificationPluginInfo).getImage(), is(nullValue()));
assertThat(new CombinedPluginInfo(pluggableTaskPluginInfo).getImage(), is(nullValue()));
assertThat(new CombinedPluginInfo(asList(pluggableTaskPluginInfo, notificationPluginInfo)).getImage(), is(nullValue()));
}
use of com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo in project gocd by gocd.
the class CombinedPluginInfoTest method shouldFindAnExtensionOfAGivenTypeIfItExists.
@Test
public void shouldFindAnExtensionOfAGivenTypeIfItExists() throws Exception {
NotificationPluginInfo notificationPluginInfo = new NotificationPluginInfo(null, null);
PluggableTaskPluginInfo pluggableTaskPluginInfo = new PluggableTaskPluginInfo(null, null, null);
CombinedPluginInfo pluginInfo = new CombinedPluginInfo(asList(pluggableTaskPluginInfo, notificationPluginInfo));
assertThat(pluginInfo.extensionFor(NOTIFICATION_EXTENSION), is(notificationPluginInfo));
assertThat(pluginInfo.extensionFor(PLUGGABLE_TASK_EXTENSION), is(pluggableTaskPluginInfo));
assertThat(pluginInfo.extensionFor(ANALYTICS_EXTENSION), is(nullValue()));
}
use of com.thoughtworks.go.plugin.domain.notification.NotificationPluginInfo in project gocd by gocd.
the class CombinedPluginInfoTest method shouldGetDescriptorOfPluginUsingAnyPluginInfo.
@Test
public void shouldGetDescriptorOfPluginUsingAnyPluginInfo() throws Exception {
PluginDescriptor descriptor = mock(PluginDescriptor.class);
NotificationPluginInfo notificationPluginInfo = new NotificationPluginInfo(descriptor, null);
PluggableTaskPluginInfo pluggableTaskPluginInfo = new PluggableTaskPluginInfo(descriptor, null, null);
CombinedPluginInfo pluginInfo = new CombinedPluginInfo(asList(pluggableTaskPluginInfo, notificationPluginInfo));
assertThat(pluginInfo.getDescriptor(), is(descriptor));
}
Aggregations