From b16866d9262240e4b0668f2c91cb187b65d88a76 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Mon, 8 Feb 2016 09:31:48 +0100 Subject: [PATCH] Fix quality flaw --- .../java/org/sonar/server/qualitygate/ws/AppAction.java | 6 +----- .../java/org/sonar/server/qualitygate/ws/AppActionTest.java | 2 +- .../java/org/sonar/server/qualitygate/ws/QGatesWsTest.java | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/AppAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/AppAction.java index fcbed4cfc72..81e5ec071ab 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/AppAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualitygate/ws/AppAction.java @@ -25,18 +25,14 @@ import org.sonar.api.server.ws.Request; import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.api.utils.text.JsonWriter; -import org.sonar.core.timemachine.Periods; import org.sonar.server.qualitygate.QualityGates; public class AppAction implements QGateWsAction { private final QualityGates qualityGates; - private final Periods periods; - - public AppAction(QualityGates qualityGates, Periods periods) { + public AppAction(QualityGates qualityGates) { this.qualityGates = qualityGates; - this.periods = periods; } @Override diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/AppActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/AppActionTest.java index b02c7e783e6..cec59426d92 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/AppActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/AppActionTest.java @@ -67,7 +67,7 @@ public class AppActionTest { new CreateAction(qGates), new CopyAction(qGates), new DestroyAction(qGates), new RenameAction(qGates), new SetAsDefaultAction(qGates), new UnsetDefaultAction(qGates), new CreateConditionAction(qGates), new UpdateConditionAction(qGates), new DeleteConditionAction(qGates), - new SelectAction(qGates), new DeselectAction(qGates), new AppAction(qGates, periods))); + new SelectAction(qGates), new DeselectAction(qGates), new AppAction(qGates))); } @Test diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java index 448b09e7281..39fb85de5e9 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QGatesWsTest.java @@ -33,7 +33,6 @@ import org.sonar.db.qualitygate.ProjectQgateAssociation; import org.sonar.db.qualitygate.ProjectQgateAssociationQuery; import org.sonar.db.qualitygate.QualityGateConditionDto; import org.sonar.db.qualitygate.QualityGateDto; -import org.sonar.core.timemachine.Periods; import org.sonar.server.exceptions.BadRequestException; import org.sonar.server.qualitygate.QgateProjectFinder; import org.sonar.server.qualitygate.QgateProjectFinder.Association; @@ -70,7 +69,7 @@ public class QGatesWsTest { new CreateAction(qGates), new CopyAction(qGates), new DestroyAction(qGates), new RenameAction(qGates), new SetAsDefaultAction(qGates), new UnsetDefaultAction(qGates), new CreateConditionAction(qGates), new UpdateConditionAction(qGates), new DeleteConditionAction(qGates), - new SelectAction(qGates), new DeselectAction(qGates), new AppAction(qGates, mock(Periods.class)))); + new SelectAction(qGates), new DeselectAction(qGates), new AppAction(qGates))); } @Test -- 2.39.5