Getting blank response in spring rest controller unit test cases
问题 I have written unit test cases for a spring rest controller for below put method @PutMapping("/offers/{jobTitle}") public Offer updateOffer(@PathVariable String jobTitle,@Valid @RequestBody Offer offer) { return offerService.updateNoOfPost(jobTitle, offer); } Below is my service class @Override public Offer updateNoOfPost(String jobTitle, Offer offer) { if(!offerRepository.existsById(jobTitle)) throw new ResourceNotFoundException("JobTitle "+jobTitle+" not found !!"); offer.setNoOfPost(offer