aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-03-24 10:16:03 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-03-24 10:16:36 +0100
commit290f7c401b1c349a11c50c17f5c867009077f543 (patch)
tree06cf8c2f972d66d2043fe6f99d20c5f7df94d238 /sonar-batch
parent631cea2c6bf952460e5239c2862c43d22edf529b (diff)
downloadsonarqube-290f7c401b1c349a11c50c17f5c867009077f543.tar.gz
sonarqube-290f7c401b1c349a11c50c17f5c867009077f543.zip
SONAR-6275 Add temporary field person_id on measure to keep devcockpit working
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/report/MeasuresPublisher.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/report/MeasuresPublisherTest.java4
2 files changed, 7 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/MeasuresPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/MeasuresPublisher.java
index c13e833b9e5..e7c524ff52d 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/report/MeasuresPublisher.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/report/MeasuresPublisher.java
@@ -182,6 +182,10 @@ public class MeasuresPublisher implements ReportPublisher {
if (charac != null) {
builder.setCharactericId(charac.id());
}
+ Integer personId = measure.getPersonId();
+ if (personId != null) {
+ builder.setPersonId(personId);
+ }
return builder.build();
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/report/MeasuresPublisherTest.java b/sonar-batch/src/test/java/org/sonar/batch/report/MeasuresPublisherTest.java
index b63fc63ad27..29a75622c8f 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/report/MeasuresPublisherTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/report/MeasuresPublisherTest.java
@@ -94,7 +94,8 @@ public class MeasuresPublisherTest {
.setAlertStatus(Level.ERROR)
.setAlertText("Foo")
.setTendency(-1)
- .setCharacteristic(mock(Characteristic.class));
+ .setCharacteristic(mock(Characteristic.class))
+ .setPersonId(2);
// No value on new_xxx
Measure measure2 = new Measure<>(CoreMetrics.NEW_BLOCKER_VIOLATIONS)
.setVariation1(1.0)
@@ -135,6 +136,7 @@ public class MeasuresPublisherTest {
assertThat(componentMeasures.get(0).getDoubleValue()).isEqualTo(2.0);
assertThat(componentMeasures.get(0).getAlertStatus()).isEqualTo("ERROR");
assertThat(componentMeasures.get(0).getAlertText()).isEqualTo("Foo");
+ assertThat(componentMeasures.get(0).getPersonId()).isEqualTo(2);
}