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>
* }
* </pre>
*/
- public static void writeUpdate(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
+ static void writeUpdate(JsonWriter jsonWriter, PluginUpdate pluginUpdate) {
jsonWriter.name(OBJECT_UPDATE).beginObject();
writeUpdateProperties(jsonWriter, pluginUpdate);
" }" +
"}");
}
-
- @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");