Search in sources :

Example 26 with GoPluginBundleDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginBundleDescriptor in project gocd by gocd.

the class DefaultPluginRegistryServiceTest method shouldGetIDOfFirstPluginInBundle.

@Test
void shouldGetIDOfFirstPluginInBundle() {
    final GoPluginDescriptor pluginDescriptor1 = GoPluginDescriptor.builder().id("plugin.1").build();
    final GoPluginDescriptor pluginDescriptor2 = GoPluginDescriptor.builder().id("plugin.2").build();
    final GoPluginBundleDescriptor bundleDescriptor = new GoPluginBundleDescriptor(pluginDescriptor1, pluginDescriptor2);
    when(pluginRegistry.getBundleDescriptor(bundleDescriptor.bundleSymbolicName())).thenReturn(bundleDescriptor);
    final String pluginIDOfFirstPluginInBundle = serviceDefault.getPluginIDOfFirstPluginInBundle(bundleDescriptor.bundleSymbolicName());
    assertThat(pluginIDOfFirstPluginInBundle).isEqualTo("plugin.1");
}
Also used : GoPluginBundleDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginBundleDescriptor) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) Test(org.junit.jupiter.api.Test)

Aggregations

GoPluginBundleDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginBundleDescriptor)26 Test (org.junit.jupiter.api.Test)20 Bundle (org.osgi.framework.Bundle)13 GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)11 GoPlugin (com.thoughtworks.go.plugin.api.GoPlugin)8 BundleContext (org.osgi.framework.BundleContext)8 ServiceReference (org.osgi.framework.ServiceReference)8 File (java.io.File)7 BeforeEach (org.junit.jupiter.api.BeforeEach)7 IOException (java.io.IOException)6 FileHelper (com.thoughtworks.go.plugin.FileHelper)5 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)5 DefaultPluginRegistry (com.thoughtworks.go.plugin.infra.plugininfo.DefaultPluginRegistry)4 ReflectionUtil (com.thoughtworks.go.util.ReflectionUtil)4 ZipUtil (com.thoughtworks.go.util.ZipUtil)4 HashMap (java.util.HashMap)4 ZipInputStream (java.util.zip.ZipInputStream)4 FileUtils (org.apache.commons.io.FileUtils)4 BundleClassLoader (org.apache.felix.framework.BundleWiringImpl.BundleClassLoader)4 FelixConstants (org.apache.felix.framework.util.FelixConstants)4