+ assertThat(resp.getBody()).contains(EI_TYPE_ID);
+ assertThat(resp.getBody()).contains(EI_TYPE_ID_2);
+ }
+
+ @Test
+ void testReplacingEiProducerTypes() throws Exception {
+ final String REPLACED_TYPE_ID = "replaced";
+ putEiProducerWithOneType(EI_PRODUCER_ID, REPLACED_TYPE_ID);
+ putEiProducerWithOneType(EI_PRODUCER_ID, EI_TYPE_ID);
+
+ String url = ProducerConsts.API_ROOT + "/eitypes";
+
+ ResponseEntity<String> resp = restClient().getForEntity(url).block();
+ assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
+ assertThat(resp.getBody()).contains(EI_TYPE_ID);
+ assertThat(resp.getBody()).doesNotContain(REPLACED_TYPE_ID);
+ }
+
+ @Test
+ void testChangingEiTypeGetRejected() throws Exception {
+ putEiProducerWithOneType("producer1", "typeId1");
+ putEiProducerWithOneType("producer2", "typeId2");
+ putEiJob("typeId1", "jobId");
+
+ String url = ConsumerConsts.API_ROOT + "/eitypes/typeId2/eijobs/jobId";
+ String body = gson.toJson(eiJobInfo());
+ testErrorCode(restClient().put(url, body), HttpStatus.CONFLICT,
+ "Not allowed to change type for existing EI job");