@Override
    public void pluginJarAdded(BundleOrPluginFileDetails bundleOrPluginFileDetails) {
        final GoPluginBundleDescriptor bundleDescriptor = goPluginBundleDescriptorBuilder.build(bundleOrPluginFileDetails);

        try {
            LOGGER.info("Plugin load starting: {}", bundleOrPluginFileDetails.file());

            validateIfExternalPluginRemovingBundledPlugin(bundleDescriptor);
            validatePluginCompatibilityWithCurrentOS(bundleDescriptor);
            validatePluginCompatibilityWithGoCD(bundleDescriptor);
            addPlugin(bundleOrPluginFileDetails, bundleDescriptor);
        } finally {
            LOGGER.info("Plugin load finished: {}", bundleOrPluginFileDetails.file());
        }
    }
@Test
    void shouldLoadAPluginWhenAListOfTargetOSesIsNotDeclaredByThePluginInItsXML() throws Exception {
        File pluginJarFile = new File(pluginWorkDir, PLUGIN_JAR_FILE_NAME);

        copyPluginToTheDirectory(pluginWorkDir, PLUGIN_JAR_FILE_NAME);
        GoPluginBundleDescriptor descriptor = new GoPluginBundleDescriptor(getPluginDescriptor("some.old.id", "1.0", pluginJarFile.getAbsolutePath(), new File(PLUGIN_JAR_FILE_NAME), false, null));
        when(systemEnvironment.getOperatingSystemFamilyJvmName()).thenReturn("Windows");
        when(goPluginBundleDescriptorBuilder.build(new BundleOrPluginFileDetails(pluginJarFile, true, pluginWorkDir))).thenReturn(descriptor);

        listener = new DefaultPluginJarChangeListener(registry, osgiManifestGenerator, pluginLoader, goPluginBundleDescriptorBuilder, systemEnvironment);
        listener.pluginJarAdded(new BundleOrPluginFileDetails(pluginJarFile, true, pluginWorkDir));

        verify(registry, times(1)).loadPlugin(descriptor);
        verify(pluginLoader, times(1)).loadPlugin(descriptor);
    }