diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2021-02-24 16:21:15 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-02-26 20:07:40 +0000 |
commit | c10b2400c36effa257e86f17ea55990a71c63d0a (patch) | |
tree | a99ce77e0f4d55714207fe4089d5cbab16762f9e /server | |
parent | 62f567aab40464bd3cbdf0f143cd454ceb92516f (diff) | |
download | sonarqube-c10b2400c36effa257e86f17ea55990a71c63d0a.tar.gz sonarqube-c10b2400c36effa257e86f17ea55990a71c63d0a.zip |
SONAR-13848 remove deprecated parameter 'componentKey' from api/navigation/component
Diffstat (limited to 'server')
2 files changed, 7 insertions, 8 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java index 2e011e88341..ab048d25484 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java @@ -120,13 +120,13 @@ public class ComponentAction implements NavigationWsAction { .setResponseExample(getClass().getResource("component-example.json")) .setSince("5.2") .setChangelog( + new Change("8.8", "Deprecated parameter 'componentKey' has been removed. Please use parameter 'component' instead"), new Change("7.6", String.format("The use of module keys in parameter '%s' is deprecated", PARAM_COMPONENT)), new Change("7.3", "The 'almRepoUrl' and 'almId' fields are added"), new Change("6.4", "The 'visibility' field is added")); action.createParam(PARAM_COMPONENT) .setDescription("A component key.") - .setDeprecatedKey("componentKey", "6.4") .setExampleValue(KEY_PROJECT_EXAMPLE_001); action diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java index 9eb1231c4f4..4ea440392d4 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java @@ -172,7 +172,7 @@ public class ComponentActionTest { init(); String json = ws.newRequest() - .setParam("componentKey", project.getKey()) + .setParam("component", project.getKey()) .setParam("branch", branch.getBranch()) .execute() .getInput(); @@ -229,7 +229,7 @@ public class ComponentActionTest { .setName("Main.xoo")); String json = ws.newRequest() - .setParam("componentKey", fileDto.getKey()) + .setParam("component", fileDto.getKey()) .setParam("branch", branch.getBranch()) .execute() .getInput(); @@ -309,7 +309,7 @@ public class ComponentActionTest { init(); String json = ws.newRequest() - .setParam("componentKey", project.getKey()) + .setParam("component", project.getKey()) .setParam("branch", branch.getKey()) .execute() .getInput(); @@ -651,14 +651,13 @@ public class ComponentActionTest { assertThat(action.changelog()).extracting(Change::getVersion, Change::getDescription).containsExactlyInAnyOrder( tuple("6.4", "The 'visibility' field is added"), tuple("7.3", "The 'almRepoUrl' and 'almId' fields are added"), - tuple("7.6", "The use of module keys in parameter 'component' is deprecated")); + tuple("7.6", "The use of module keys in parameter 'component' is deprecated"), + tuple("8.8", "Deprecated parameter 'componentKey' has been removed. Please use parameter 'component' instead")); WebService.Param componentId = action.param(PARAM_COMPONENT); assertThat(componentId.isRequired()).isFalse(); assertThat(componentId.description()).isNotNull(); assertThat(componentId.exampleValue()).isNotNull(); - assertThat(componentId.deprecatedKey()).isEqualTo("componentKey"); - assertThat(componentId.deprecatedKeySince()).isEqualTo("6.4"); } @Test(expected = BadRequestException.class) @@ -709,7 +708,7 @@ public class ComponentActionTest { } private String execute(String componentKey) { - return ws.newRequest().setParam("componentKey", componentKey).execute().getInput(); + return ws.newRequest().setParam("component", componentKey).execute().getInput(); } private void verify(String json, String jsonFile) { |