summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
c9b469c)
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-576
Change-Id: I2c2f071528f3b2ec939375d24cbd3a537b41b4c9
return ErrorResponse.create("The type has active producers: " + firstProducerId, HttpStatus.NOT_ACCEPTABLE);
}
this.infoTypes.remove(type);
return ErrorResponse.create("The type has active producers: " + firstProducerId, HttpStatus.NOT_ACCEPTABLE);
}
this.infoTypes.remove(type);
+ infoJobs.getJobsForType(type).forEach(job -> infoJobs.remove(job, infoProducers)); // Delete jobs for the type
this.typeSubscriptions.notifyTypeRemoved(type);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
this.typeSubscriptions.notifyTypeRemoved(type);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Test
void producerDeleteEiType() throws Exception {
putInfoType(TYPE_ID);
@Test
void producerDeleteEiType() throws Exception {
putInfoType(TYPE_ID);
+ this.putEiJob(TYPE_ID, "job1");
+ this.putEiJob(TYPE_ID, "job2");
deleteInfoType(TYPE_ID);
assertThat(this.infoTypes.size()).isZero();
deleteInfoType(TYPE_ID);
assertThat(this.infoTypes.size()).isZero();
+ assertThat(this.infoJobs.size()).isZero(); // Test that also the job is deleted
testErrorCode(restClient().delete(deleteInfoTypeUrl(TYPE_ID)), HttpStatus.NOT_FOUND,
"Information type not found");
testErrorCode(restClient().delete(deleteInfoTypeUrl(TYPE_ID)), HttpStatus.NOT_FOUND,
"Information type not found");