use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluggableTaskViewModelBuilderTest method shouldBeAbleToFetchAllPluginInfos.
@Test
public void shouldBeAbleToFetchAllPluginInfos() {
when(manager.getPluginDescriptorFor("xunit.convertor")).thenReturn(xunitConvertor);
when(manager.getPluginDescriptorFor("powershell.task")).thenReturn(powershellTask);
List<PluginInfo> pluginInfos = builder.allPluginInfos();
assertThat(pluginInfos.size(), is(2));
PluginInfo pluginInfo = pluginInfos.get(0).getId() == "xunit.convertor" ? pluginInfos.get(0) : pluginInfos.get(1);
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()));
assertNull(pluginInfo.getPluggableInstanceSettings());
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluginInfoBuilderTest method shouldBeAbleToAPluginInfoById.
@Test
public void shouldBeAbleToAPluginInfoById() {
PluginInfo pluginInfo = pluginViewModelBuilder.pluginInfoFor("email.notifier");
assertThat(pluginInfo.getId(), is(emailNotifier.id()));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class PluginInfoBuilderTest method shouldBeAbleToFetchAllPluginInfos.
@Test
public void shouldBeAbleToFetchAllPluginInfos() {
List<PluginInfo> pluginInfos = pluginViewModelBuilder.allPluginInfos(null);
assertThat(pluginInfos.size(), is(7));
List<String> expectedPlugins = new ArrayList<>();
for (PluginInfo pluginInfo : pluginInfos) {
expectedPlugins.add(pluginInfo.getId());
}
assertTrue(expectedPlugins.contains(githubDescriptor.id()));
assertTrue(expectedPlugins.contains(emailNotifier.id()));
assertTrue(expectedPlugins.contains(yumPoller.id()));
assertTrue(expectedPlugins.contains(xunitConvertor.id()));
assertTrue(expectedPlugins.contains(githubPR.id()));
assertTrue(expectedPlugins.contains(dockerElasticAgentPlugin.id()));
assertTrue(expectedPlugins.contains(ldapAuthPlugin.id()));
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class AuthenticationViewModelBuilderTest method shouldBeAbleToFetchAllPluginInfos.
@Test
public void shouldBeAbleToFetchAllPluginInfos() {
HashSet<String> pluginIds = new HashSet<>(Arrays.asList("github.oauth", "google.oauth"));
when(registry.getAuthenticationPlugins()).thenReturn(pluginIds);
when(manager.getPluginDescriptorFor("github.oauth")).thenReturn(githubDescriptor);
when(manager.getPluginDescriptorFor("google.oauth")).thenReturn(googleDescriptor);
List<PluginInfo> pluginInfos = builder.allPluginInfos();
assertThat(pluginInfos.size(), is(2));
PluginInfo pluginInfo = pluginInfos.get(0).getId() == "github.oauth" ? pluginInfos.get(0) : pluginInfos.get(1);
assertThat(pluginInfo.getId(), is("github.oauth"));
assertThat(pluginInfo.getType(), is("authentication"));
assertThat(pluginInfo.getName(), is(githubDescriptor.about().name()));
assertThat(pluginInfo.getVersion(), is(githubDescriptor.about().version()));
assertNull(pluginInfo.getPluggableInstanceSettings());
}
use of com.thoughtworks.go.server.ui.plugins.PluginInfo in project gocd by gocd.
the class AuthenticationViewModelBuilderTest method shouldBeAbleToFetchAPluginInfoForAGivenId.
@Test
public void shouldBeAbleToFetchAPluginInfoForAGivenId() {
HashSet<String> pluginIds = new HashSet<>(Arrays.asList("github.oauth", "google.oauth"));
when(registry.getAuthenticationPlugins()).thenReturn(pluginIds);
when(manager.getPluginDescriptorFor("github.oauth")).thenReturn(githubDescriptor);
PluginInfo pluginInfo = builder.pluginInfoFor("github.oauth");
assertThat(pluginInfo.getId(), is("github.oauth"));
assertThat(pluginInfo.getType(), is("authentication"));
assertThat(pluginInfo.getName(), is(githubDescriptor.about().name()));
assertThat(pluginInfo.getVersion(), is(githubDescriptor.about().version()));
assertNull(pluginInfo.getPluggableInstanceSettings());
}
Aggregations