From cbe566e4524c19dce6ef5aa21d6c6e6445d26761 Mon Sep 17 00:00:00 2001 From: DDMili <130993898+dejan-milisavljevic-sonarsource@users.noreply.github.com> Date: Wed, 8 May 2024 11:02:52 +0200 Subject: [PATCH] SONAR-22121 Move security reports pdf generation to its own library Co-authored-by: OrlovAlexander <35396155+OrlovAlexander85@users.noreply.github.com> --- build.gradle | 1 + .../testFixtures/java/org/sonar/server/es/EsTester.java | 9 ++++++++- settings.gradle | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 4b4050fa8b8..6339a10c62c 100644 --- a/build.gradle +++ b/build.gradle @@ -450,6 +450,7 @@ subprojects { } dependency 'org.junit.platform:junit-platform-suite-api:1.10.2' dependency 'org.junit.platform:junit-platform-suite-engine:1.10.2' + dependency 'com.sonarsource.pdfreport:security-report-pdf-generation:1.0.0.98' dependency 'org.sonarsource.update-center:sonar-update-center-common:1.32.0.2441' dependency("org.springframework:spring-context:${springVersion}") { exclude 'commons-logging:commons-logging' diff --git a/server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java b/server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java index 813f13aa96e..e507624ab2e 100644 --- a/server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java +++ b/server/sonar-server-common/src/testFixtures/java/org/sonar/server/es/EsTester.java @@ -85,6 +85,8 @@ import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.transport.Netty4Plugin; +import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.rules.ExternalResource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -109,7 +111,7 @@ import static org.sonar.server.es.Index.ALL_INDICES; import static org.sonar.server.es.IndexType.FIELD_INDEX_TYPE; import static org.sonar.server.es.newindex.DefaultIndexSettings.REFRESH_IMMEDIATE; -public class EsTester extends ExternalResource { +public class EsTester extends ExternalResource implements AfterEachCallback { private static final int MIN_PORT = 1; private static final int MAX_PORT = 49151; @@ -175,6 +177,11 @@ public class EsTester extends ExternalResource { create(); } + @Override + public void afterEach(ExtensionContext extensionContext) throws Exception { + after(); + } + @Override protected void after() { if (isCustom) { diff --git a/settings.gradle b/settings.gradle index 284b3f241d2..22d2fa50fdb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -88,3 +88,4 @@ buildCache { enabled = !isCiServer } } + -- 2.39.5