diff --git a/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java b/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java index ef1b7da9..5604abdb 100644 --- a/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java +++ b/src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java @@ -154,7 +154,6 @@ public void start() throws Exception { // because, for some unknown reasons, we reach plexus bootstraping exceptions when // calling Embedder.start() when everything is loaded (very strange...) SCMManagerFactory.getInstance().start(); - initialInit(); } public void loadData(ScmSyncConfigurationPOJO pojo){ @@ -166,14 +165,6 @@ public void loadData(ScmSyncConfigurationPOJO pojo){ this.manualSynchronizationIncludes = pojo.getManualSynchronizationIncludes(); } - protected void initialInit() throws Exception { - // We need to init() here in addition to ScmSyncConfigurationItemListener.onLoaded() to ensure that we do - // indeed create the SCM work directory when we are loaded. Otherwise, the plugin can be installed but - // then fails to operate until the next time Jenkins is restarted. Using postInitialize() for this might - // be too late if the plugin is copied to the plugin directory and then Jenkins is started. - this.business.init(createScmContext()); - } - public void init() { try { this.business.init(createScmContext()); diff --git a/src/test/java/hudson/plugins/scm_sync_configuration/util/ScmSyncConfigurationBaseTest.java b/src/test/java/hudson/plugins/scm_sync_configuration/util/ScmSyncConfigurationBaseTest.java index 2bef1afe..7fba8846 100644 --- a/src/test/java/hudson/plugins/scm_sync_configuration/util/ScmSyncConfigurationBaseTest.java +++ b/src/test/java/hudson/plugins/scm_sync_configuration/util/ScmSyncConfigurationBaseTest.java @@ -75,12 +75,7 @@ public void setup() throws Throwable { // Instantiating ScmSyncConfigurationPlugin instance for unit tests by using // synchronous transactions (instead of an asynchronous ones) // => this way, every commit will be processed synchronously ! - ScmSyncConfigurationPlugin scmSyncConfigPluginInstance = new ScmSyncConfigurationPlugin(true) { - @Override - public void initialInit() throws Exception { - // No-op. We *must not* initialize here in tests because the tests provide their own setup. - } - }; + ScmSyncConfigurationPlugin scmSyncConfigPluginInstance = new ScmSyncConfigurationPlugin(true); // Mocking PluginWrapper attached to current ScmSyncConfigurationPlugin instance PluginWrapper pluginWrapper = PowerMockito.mock(PluginWrapper.class);