From 11f875035fa31bc81a55bebffa13f18653425981 Mon Sep 17 00:00:00 2001 From: Dejan Milisavljevic Date: Tue, 27 Feb 2024 16:17:46 +0100 Subject: [PATCH] SONAR-21738 Fix issues blocking Quality Gate --- .../projectanalysis/step/LoadQualityProfilesStepTest.java | 2 +- .../it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStepTest.java index 80bb922ebab..70b74b91608 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStepTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStepTest.java @@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.sonar.db.rule.RuleTesting.XOO_X1; import static org.sonar.db.rule.RuleTesting.XOO_X2; -public class LoadQualityProfilesStepTest { +class LoadQualityProfilesStepTest { @RegisterExtension private final BatchReportReaderRule batchReportReader = new BatchReportReaderRule(); diff --git a/server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java b/server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java index 4a64711c05a..60b753a3a74 100644 --- a/server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java +++ b/server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java @@ -111,14 +111,14 @@ class CeWorkerImplIT { @Test void constructor_throws_IAE_if_ordinal_is_less_than_zero() { - assertThatThrownBy(() -> new CeWorkerImpl(-1 - new Random().nextInt(20), workerUuid, queue, taskProcessorRepository, ceWorkerController)) + assertThatThrownBy(() -> new CeWorkerImpl(-1, workerUuid, queue, taskProcessorRepository, ceWorkerController)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Ordinal must be >= 0"); } @Test void getUUID_must_return_the_uuid_of_constructor() { - String uuid = UUID.randomUUID().toString(); + String uuid = "de338f4f-a06f-474f-8ad0-9941b7455904"; CeWorker underTest = new CeWorkerImpl(ordinal, uuid, queue, taskProcessorRepository, ceWorkerController); assertThat(underTest.getUUID()).isEqualTo(uuid); } -- 2.39.5