]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10591 remove unused method PluginWSCommons#writeArtifact()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 10 May 2018 20:00:48 +0000 (22:00 +0200)
committerSonarTech <sonartech@sonarsource.com>
Fri, 11 May 2018 18:20:47 +0000 (20:20 +0200)
server/sonar-server/src/main/java/org/sonar/server/plugins/ws/PluginWSCommons.java
server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PluginWSCommonsTest.java

index 8cd0e1ae351e03fb48af092f4bcecf49687373c9..6bbad94e3b3d0f3a991df780e485ddc17419820b 100644 (file)
@@ -158,15 +158,6 @@ public class PluginWSCommons {
     jsonWriter.endObject();
   }
 
-  public static void writeArtifact(JsonWriter jsonWriter, Release release) {
-    jsonWriter.name(OBJECT_ARTIFACT).beginObject();
-
-    jsonWriter.prop(PROPERTY_NAME, release.getFilename());
-    jsonWriter.prop(PROPERTY_URL, release.getDownloadUrl());
-
-    jsonWriter.endObject();
-  }
-
   /**
    * Write an "update" object to the specified jsonwriter.
    * <pre>
@@ -182,7 +173,7 @@ public class PluginWSCommons {
    * }
    * </pre>
    */
-  public static void writeUpdate(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
+  static void writeUpdate(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
     jsonWriter.name(OBJECT_UPDATE).beginObject();
 
     writeUpdateProperties(jsonWriter, pluginUpdate);
index 1a622809b3382332564423ddc60ac993b95ccd6e..4ffd08174ad0dd2412887418eef0db5a007127ee 100644 (file)
@@ -192,22 +192,6 @@ public class PluginWSCommonsTest {
       "  }" +
       "}");
   }
-
-  @Test
-  public void writeArtifact_from_release_writes_artifact_object_and_file_name() {
-    jsonWriter.beginObject();
-    PluginWSCommons.writeArtifact(jsonWriter, release("pkey").setDownloadUrl("http://toto.com/file.jar"));
-    jsonWriter.endObject();
-
-    jsonWriter.close();
-    assertJson(response.outputAsString()).withStrictArrayOrder().isSimilarTo("{" +
-      "  \"artifact\": {" +
-      "     \"name\": \"file.jar\"," +
-      "     \"url\": \"http://toto.com/file.jar\"" +
-      "  }" +
-      "}");
-  }
-
   @Test
   public void status_COMPATIBLE_is_displayed_COMPATIBLE_in_JSON() {
     assertThat(toJSon(COMPATIBLE)).isEqualTo("COMPATIBLE");