"targetUri", "jobStatusUrl");
String body = gson.toJson(jobInfo);
- testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "Json validation failure");
+ testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "Json validation failure");
+
+ testErrorCode(restClient().put(url, "{jojo}"), HttpStatus.BAD_REQUEST, "", false);
+
}
@Test
new ConsumerJobInfo("typeId", jsonObject("{ \"XXstring\" : \"value\" }"), "owner", "targetUri", null);
String body = gson.toJson(jobInfo);
- testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "Json validation failure");
+ testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "Json validation failure");
}
@Test
ConsumerJobInfo jobInfo = new ConsumerJobInfo(TYPE_ID, jsonObject(), "owner", "junk", null);
String body = gson.toJson(jobInfo);
- testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT, "URI: junk is not absolute");
+ testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "URI: junk is not absolute");
}
@Test
String url = ProducerConsts.API_ROOT + "/info-types/" + TYPE_ID;
String body = "{}";
testErrorCode(restClient().put(url, body), HttpStatus.BAD_REQUEST, "No schema provided");
+
+ testErrorCode(restClient().post(url, body), HttpStatus.METHOD_NOT_ALLOWED, "", false);
}
@Test
void producerDeleteEiTypeExistingProducer() throws Exception {
putInfoProducerWithOneType(PRODUCER_ID, TYPE_ID);
String url = ProducerConsts.API_ROOT + "/info-types/" + TYPE_ID;
- testErrorCode(restClient().delete(url), HttpStatus.NOT_ACCEPTABLE,
- "The type has active producers: " + PRODUCER_ID);
+ testErrorCode(restClient().delete(url), HttpStatus.CONFLICT, "The type has active producers: " + PRODUCER_ID);
assertThat(this.infoTypes.size()).isEqualTo(1);
}