diff options
author | Dimitris Kavvathas <dimitris.kavvathas@sonarsource.com> | 2022-06-03 13:20:00 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-06-03 20:03:04 +0000 |
commit | 4e7d51ee75ff9438688627d30ac31181b53610c3 (patch) | |
tree | 26a4ab25b8f58ee35ea2f5a1bdf433491d7202d1 /server/sonar-webserver-api | |
parent | 5bf97e8c831e996b97a6a3559f9a7be78e663970 (diff) | |
download | sonarqube-4e7d51ee75ff9438688627d30ac31181b53610c3.tar.gz sonarqube-4e7d51ee75ff9438688627d30ac31181b53610c3.zip |
SONAR-14503: Remove `plugin` word from the installed plugins log message
Diffstat (limited to 'server/sonar-webserver-api')
2 files changed, 11 insertions, 2 deletions
diff --git a/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginManager.java b/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginManager.java index 6f83c583991..8e5ed0a01f1 100644 --- a/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginManager.java +++ b/server/sonar-webserver-api/src/main/java/org/sonar/server/plugins/ServerPluginManager.java @@ -80,7 +80,7 @@ public class ServerPluginManager implements Startable { } private static void logInstalledPlugins(Collection<ServerPluginInfo> plugins) { - plugins.stream().sorted().forEach(plugin -> LOG.info("Deploy plugin {} / {} / {}", plugin.getName(), plugin.getVersion(), plugin.getImplementationBuild())); + plugins.stream().sorted().forEach(plugin -> LOG.info("Deploy {} / {} / {}", plugin.getName(), plugin.getVersion(), plugin.getImplementationBuild())); } private Collection<ExplodedPlugin> extractPlugins(Collection<ServerPluginInfo> plugins) { diff --git a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginManagerTest.java b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginManagerTest.java index d81139264a2..a219caadbca 100644 --- a/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginManagerTest.java +++ b/server/sonar-webserver-api/src/test/java/org/sonar/server/plugins/ServerPluginManagerTest.java @@ -33,6 +33,7 @@ import org.sonar.core.platform.ExplodedPlugin; import org.sonar.core.platform.PluginClassLoader; import org.sonar.core.platform.PluginJarExploder; import org.sonar.server.plugins.PluginFilesAndMd5.FileAndMd5; +import org.sonar.updatecenter.common.Version; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; @@ -44,7 +45,7 @@ import static org.sonar.server.plugins.PluginType.EXTERNAL; public class ServerPluginManagerTest { @Rule - public LogTester logs = new LogTester(); + public LogTester logTester = new LogTester(); private PluginClassLoader pluginClassLoader = mock(PluginClassLoader.class); private PluginJarExploder jarExploder = mock(PluginJarExploder.class); @@ -80,6 +81,9 @@ public class ServerPluginManagerTest { .extracting(ServerPlugin::getPluginInfo, ServerPlugin::getCompressed, ServerPlugin::getJar, ServerPlugin::getInstance) .containsOnly(tuple(p1, p1Files.getCompressedJar(), p1Files.getLoadedJar(), instances.get("p1")), tuple(p2, p2Files.getCompressedJar(), p2Files.getLoadedJar(), instances.get("p2"))); + + assertThat(pluginRepository.getPlugins()).extracting(ServerPlugin::getPluginInfo) + .allMatch(p -> logTester.logs().contains(String.format("Deploy %s / %s / %s", p.getName(), p.getVersion(), p.getImplementationBuild()))); } private static ServerPluginInfo newPluginInfo(String key) { @@ -87,6 +91,11 @@ public class ServerPluginManagerTest { when(pluginInfo.getKey()).thenReturn(key); when(pluginInfo.getType()).thenReturn(EXTERNAL); when(pluginInfo.getNonNullJarFile()).thenReturn(new File(key + ".jar")); + when(pluginInfo.getName()).thenReturn(key + "_name"); + Version version = mock(Version.class); + when(version.getName()).thenReturn(key + "_version"); + when(pluginInfo.getVersion()).thenReturn(version); + when(pluginInfo.getImplementationBuild()).thenReturn(key + "_implementationBuild"); return pluginInfo; } |