aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-07-18 11:25:17 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-07-22 00:31:16 +0200
commit7e87812f0c2a3000368e76b2965360c476f8ec10 (patch)
treefa7f0e2f0eb78046df834c60339ddf886fbf4ab1 /sonar-ws
parent0358ec707893e66fc1e915d75eb565a8e7bf8445 (diff)
downloadsonarqube-7e87812f0c2a3000368e76b2965360c476f8ec10.tar.gz
sonarqube-7e87812f0c2a3000368e76b2965360c476f8ec10.zip
SONAR-9516 remove deprecated params from client of WS api/projects/delete
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/project/DeleteRequest.java12
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java3
-rw-r--r--sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java14
3 files changed, 4 insertions, 25 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/DeleteRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/DeleteRequest.java
index c21edd90113..0d798bd54f2 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/DeleteRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/DeleteRequest.java
@@ -26,11 +26,9 @@ import javax.annotation.concurrent.Immutable;
@Immutable
public class DeleteRequest {
- private final String id;
private final String key;
private DeleteRequest(Builder builder) {
- this.id = builder.id;
this.key = builder.key;
}
@@ -39,11 +37,6 @@ public class DeleteRequest {
return key;
}
- @CheckForNull
- public String getId() {
- return id;
- }
-
public static Builder builder() {
return new Builder();
}
@@ -54,11 +47,6 @@ public class DeleteRequest {
private Builder() {
}
- public Builder setId(@Nullable String id) {
- this.id = id;
- return this;
- }
-
public Builder setKey(@Nullable String key) {
this.key = key;
return this;
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java
index 71b31ef1d1d..f43c40d50be 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/project/ProjectsService.java
@@ -78,8 +78,7 @@ public class ProjectsService extends BaseService {
*/
public void delete(DeleteRequest request) {
call(new PostRequest(path("delete"))
- .setParam("id", request.getId())
- .setParam("key", request.getKey()));
+ .setParam("project", request.getKey()));
}
public void bulkDelete(BulkDeleteRequest request) {
diff --git a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java
index 8420491f422..8d21940ab02 100644
--- a/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java
+++ b/sonar-ws/src/test/java/org/sonarqube/ws/client/project/ProjectsServiceTest.java
@@ -116,19 +116,11 @@ public class ProjectsServiceTest {
}
@Test
- public void deletes_project_by_id() {
- underTest.delete(DeleteRequest.builder().setId("abc").build());
+ public void delete() {
+ underTest.delete(DeleteRequest.builder().setKey("P1").build());
assertThat(serviceTester.getPostRequest().getPath()).isEqualTo("api/projects/delete");
- assertThat(serviceTester.getPostRequest().getParams()).containsOnly(entry("id", "abc"));
- }
-
- @Test
- public void deletes_project_by_key() {
- underTest.delete(DeleteRequest.builder().setKey("project_key").build());
-
- assertThat(serviceTester.getPostRequest().getPath()).isEqualTo("api/projects/delete");
- assertThat(serviceTester.getPostRequest().getParams()).containsOnly(entry("key", "project_key"));
+ assertThat(serviceTester.getPostRequest().getParams()).containsOnly(entry("project", "P1"));
}
@Test