use of com.thoughtworks.go.plugin.domain.pluggabletask.PluggableTaskPluginInfo in project gocd by gocd.
the class PluggableTaskPluginInfoBuilderTest method shouldBuildPluginInfo.
@Test
public void shouldBuildPluginInfo() throws Exception {
GoPluginDescriptor descriptor = new GoPluginDescriptor("plugin1", null, null, null, null, false);
PluggableTaskPluginInfo pluginInfo = new PluggableTaskPluginInfoBuilder(extension).pluginInfoFor(descriptor);
List<PluginConfiguration> pluginConfigurations = Arrays.asList(new PluginConfiguration("username", new Metadata(true, false)), new PluginConfiguration("password", new Metadata(true, true)));
PluginView pluginView = new PluginView("some html");
assertThat(pluginInfo.getDescriptor(), is(descriptor));
assertThat(pluginInfo.getExtensionName(), is("task"));
assertThat(pluginInfo.getDisplayName(), is("my task plugin"));
assertThat(pluginInfo.getTaskSettings(), is(new PluggableInstanceSettings(pluginConfigurations, pluginView)));
assertNull(pluginInfo.getPluginSettings());
}
use of com.thoughtworks.go.plugin.domain.pluggabletask.PluggableTaskPluginInfo 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.pluggabletask.PluggableTaskPluginInfo 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.pluggabletask.PluggableTaskPluginInfo 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));
}
use of com.thoughtworks.go.plugin.domain.pluggabletask.PluggableTaskPluginInfo in project gocd by gocd.
the class CombinedPluginInfoTest method shouldGetAllIndividualExtensionInfos.
@Test
public void shouldGetAllIndividualExtensionInfos() throws Exception {
NotificationPluginInfo notificationPluginInfo = new NotificationPluginInfo(null, null);
PluggableTaskPluginInfo pluggableTaskPluginInfo = new PluggableTaskPluginInfo(null, null, null);
CombinedPluginInfo pluginInfo = new CombinedPluginInfo(asList(pluggableTaskPluginInfo, notificationPluginInfo));
assertThat(pluginInfo.getExtensionInfos(), containsInAnyOrder(notificationPluginInfo, pluggableTaskPluginInfo));
}
Aggregations