import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.BufferedReader;
String url = "/v2/api-docs";
ResponseEntity<String> resp = restClient().getForEntity(url).block();
assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
-
- JsonElement jsonElement = JsonParser.parseString(resp.getBody());
+ JsonObject jsonElement = JsonParser.parseString(resp.getBody()).getAsJsonObject();
+ jsonElement.remove("host");
String indented = gson.toJson(jsonElement);
try (PrintStream out = new PrintStream(new FileOutputStream("../docs/api.json"))) {
out.println(indented);
.typeId("type1") //
.jobData(getStringFromFile("job-1.json")) //
.targetUri("http://example.com/") //
+ .owner("owner") //
.build();
assertThat(jobs).hasSize(1) //
.contains(gson.toJsonTree(wantedJobInfo));