aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-09-25 16:26:52 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-10-17 15:13:58 +0200
commit3c8d83b73b9f9af0f1395e2a90186982bff32711 (patch)
tree528858f3eb52a49add30c13194bfc622c13bbe33 /sonar-plugin-api
parent020273df819300ced5bf0f74436f8c57f4b07950 (diff)
downloadsonarqube-3c8d83b73b9f9af0f1395e2a90186982bff32711.tar.gz
sonarqube-3c8d83b73b9f9af0f1395e2a90186982bff32711.zip
SONAR-9871 move webhook code to use it in web
as well as we use it in CE report processing
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/PostProjectAnalysisTaskTester.java87
1 files changed, 44 insertions, 43 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/PostProjectAnalysisTaskTester.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/PostProjectAnalysisTaskTester.java
index 2c9e358071b..2ab390b0cff 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/PostProjectAnalysisTaskTester.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/posttask/PostProjectAnalysisTaskTester.java
@@ -177,60 +177,61 @@ public class PostProjectAnalysisTaskTester {
return this;
}
- public void execute() {
+ public PostProjectAnalysisTask.ProjectAnalysis execute() {
requireNonNull(ceTask, CE_TASK_CAN_NOT_BE_NULL);
requireNonNull(project, PROJECT_CAN_NOT_BE_NULL);
requireNonNull(date, DATE_CAN_NOT_BE_NULL);
- this.underTest.finished(
- new PostProjectAnalysisTask.ProjectAnalysis() {
- @Override
- public ScannerContext getScannerContext() {
- return scannerContext;
- }
-
- @Override
- public CeTask getCeTask() {
- return ceTask;
- }
-
- @Override
- public Project getProject() {
- return project;
- }
-
- @Override
- public Optional<Branch> getBranch() {
- return Optional.ofNullable(branch);
- }
-
- @Override
- public QualityGate getQualityGate() {
- return qualityGate;
- }
-
- @Override
- public Date getDate() {
- return date;
- }
-
- @Override
- public Optional<Date> getAnalysisDate() {
- return Optional.of(date);
- }
-
- @Override
- public String toString() {
- return "ProjectAnalysis{" +
+ PostProjectAnalysisTask.ProjectAnalysis projectAnalysis = new PostProjectAnalysisTask.ProjectAnalysis() {
+ @Override
+ public ScannerContext getScannerContext() {
+ return scannerContext;
+ }
+
+ @Override
+ public CeTask getCeTask() {
+ return ceTask;
+ }
+
+ @Override
+ public Project getProject() {
+ return project;
+ }
+
+ @Override
+ public Optional<Branch> getBranch() {
+ return Optional.ofNullable(branch);
+ }
+
+ @Override
+ public QualityGate getQualityGate() {
+ return qualityGate;
+ }
+
+ @Override
+ public Date getDate() {
+ return date;
+ }
+
+ @Override
+ public Optional<Date> getAnalysisDate() {
+ return Optional.of(date);
+ }
+
+ @Override
+ public String toString() {
+ return "ProjectAnalysis{" +
"ceTask=" + ceTask +
", project=" + project +
", date=" + date.getTime() +
", analysisDate=" + date.getTime() +
", qualityGate=" + qualityGate +
'}';
- }
- });
+ }
+ };
+ this.underTest.finished(projectAnalysis);
+ return projectAnalysis;
}
public static final class CeTaskBuilder {