JSONObject jsonObj = new JSONObject(resp.getBody());
jsonObj.remove("host");
+ assertThat(jsonObj.getJSONObject("definitions").remove("Mono«ResponseEntity«object»»")).isNotNull();
+ assertThat(jsonObj.getJSONObject("definitions").remove("Void")).isNotNull();
String indented = jsonObj.toString(4);
try (PrintStream out = new PrintStream(new FileOutputStream("api/ecs-api.json"))) {
out.print(indented);
assertThat(putEiType(EI_TYPE_ID)).isEqualTo(HttpStatus.OK);
}
+ @Test
+ void testPutEiType_noSchema() {
+ String url = ProducerConsts.API_ROOT + "/eitypes/" + EI_TYPE_ID;
+ String body = "{}";
+ testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "No schema provided");
+ }
+
@Test
void testGetEiType() throws Exception {
putEiProducerWithOneType(EI_PRODUCER_ID, "test");
assertThat(request.id).isEqualTo("jobId");
}
+ @Test
+ void testPutEiProducer_noType() throws Exception {
+ String url = ProducerConsts.API_ROOT + "/eiproducers/eiProducerId";
+ String body = gson.toJson(producerEiRegistratioInfo(EI_TYPE_ID));
+ testErrorCode(restClient().put(url, body), HttpStatus.NOT_FOUND, "EI type not found");
+ }
+
@Test
void testPutProducerAndEiJob() throws Exception {
this.putEiType(EI_TYPE_ID);