From c173166cd399c3d5b93381a0a98244c1baf73650 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lièvremont Date: Thu, 10 Jan 2019 14:40:39 +0100 Subject: SONARCLOUD-312 Use key instead of UUID to send downgrade feedback (#1140) --- .../java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStep.java | 2 +- .../org/sonar/ce/task/projectanalysis/step/VerifyBillingStepTest.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'server/sonar-ce-task-projectanalysis') diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStep.java index aa2d15a9926..bcf7b193e59 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStep.java @@ -43,7 +43,7 @@ public class VerifyBillingStep implements ComputationStep { public void execute(ComputationStep.Context context) { try { Organization organization = analysisMetadata.getOrganization(); - BillingValidations.Organization billingOrganization = new BillingValidations.Organization(organization.getKey(), organization.getUuid()); + BillingValidations.Organization billingOrganization = new BillingValidations.Organization(organization.getKey(), organization.getUuid(), organization.getName()); billingValidations.checkBeforeProjectAnalysis(billingOrganization); } catch (BillingValidations.BillingValidationsException e) { throw MessageException.of(e.getMessage()); diff --git a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStepTest.java b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStepTest.java index 37dc38d55e1..0001f84f8f2 100644 --- a/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStepTest.java +++ b/server/sonar-ce-task-projectanalysis/src/test/java/org/sonar/ce/task/projectanalysis/step/VerifyBillingStepTest.java @@ -76,6 +76,8 @@ public class VerifyBillingStepTest { verify(validations).checkBeforeProjectAnalysis(orgCaptor.capture()); BillingValidations.Organization calledOrg = orgCaptor.getValue(); assertThat(calledOrg.getKey()).isEqualTo(organization.getKey()); + assertThat(calledOrg.getUuid()).isEqualTo(organization.getUuid()); + assertThat(calledOrg.getName()).isEqualTo(organization.getName()); } } -- cgit v1.2.3