From 256fd7b6a4ed35f58c144f3be861c133b8e9dc9d Mon Sep 17 00:00:00 2001 From: Eric Morand Date: Wed, 20 Nov 2024 15:17:08 +0100 Subject: [PATCH] Update the code based on PR review --- .../java/org/sonar/plugins/javascript/JavaScriptPlugin.java | 2 +- .../org/sonar/plugins/javascript/JavaScriptPluginTest.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/JavaScriptPlugin.java b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/JavaScriptPlugin.java index 524a0be8cf0..bf02f0fe3ce 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/JavaScriptPlugin.java +++ b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/JavaScriptPlugin.java @@ -346,7 +346,7 @@ public void define(Context context) { * * Note that this method should probably not be hosted here: either it should be part of a dedicated helper class, or it should be provided by a Markdown-to-HTML library. Since it is only used in this specific class, it is acceptable for now to have it hosted here. */ - protected String getHTMLMarkup(String markdownMarkup) { + private String getHTMLMarkup(String markdownMarkup) { return markdownMarkup .replace("\n", "
") .replaceAll("`(.*?)`", "$1") diff --git a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/JavaScriptPluginTest.java b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/JavaScriptPluginTest.java index dacd480c520..55a5354148d 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/JavaScriptPluginTest.java +++ b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/JavaScriptPluginTest.java @@ -23,14 +23,16 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import java.util.ArrayList; import java.util.List; import java.util.Objects; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.slf4j.event.Level; -import org.sonar.api.*; +import org.sonar.api.Plugin; +import org.sonar.api.SonarEdition; +import org.sonar.api.SonarQubeSide; +import org.sonar.api.SonarRuntime; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.internal.SonarRuntimeImpl; import org.sonar.api.testfixtures.log.LogTesterJUnit5;