]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21738 Fix issues blocking Quality Gate
authorDejan Milisavljevic <dejan.milisavljevic@sonarsource.com>
Tue, 27 Feb 2024 15:17:46 +0000 (16:17 +0100)
committersonartech <sonartech@sonarsource.com>
Tue, 27 Feb 2024 20:03:16 +0000 (20:03 +0000)
server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStepTest.java
server/sonar-ce/src/it/java/org/sonar/ce/taskprocessor/CeWorkerImplIT.java

index 80bb922ebaba8dd5ad0a81f25ebcedd303895313..70b74b916085bf0da51be26eef9da697574b8b82 100644 (file)
@@ -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();
index 4a64711c05a99e72d98d76c2039e251a9bf4e29a..60b753a3a74d2c6a1f4a71abe500a6233f31377b 100644 (file)
@@ -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);
   }