public void shouldCurrentVersionPluginConfigurationMigrationBeIdemPotent() throws Throwable {
ScmSyncConfigurationPlugin plugin = ScmSyncConfigurationPlugin.getInstance();
// Plugin has been loaded : let's record scm & repository url
String expectedRepositoryUrl = plugin.getScmRepositoryUrl();
SCM expectedScm = plugin.getSCM();
// Persisting data
mockStatic(SaveableListener.class);
doNothing().when(SaveableListener.class); SaveableListener.fireOnChange((Saveable)notNull(), (XmlFile)notNull());
plugin.save();
// Then reloading it...
PluginUtil.loadPlugin(plugin);
// Verifying repositoryUrl & SCM
assertThat(plugin.getSCM().getId(), is(equalTo(expectedScm.getId())));
assertThat(plugin.getScmRepositoryUrl(), is(equalTo(expectedRepositoryUrl)));
}