### Question:
PrescriptionController { @PutMapping("/{id}") public void update(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant, @PathVariable("id") String prescriptionId, @RequestBody Prescription prescription) { if (StringUtils.isNotBlank(prescription.getId()) && !StringUtils.equals(prescriptionId, prescription.getId())) { throw new BadRequestException("Prescription id is not valid"); } this.prescriptionService.update(prescription, grant); }  @GetMapping List<Prescription> list(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant); @PostMapping String create(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant,
			@RequestBody Prescription prescription); @GetMapping("/{id}") Prescription get(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant,
			@PathVariable("id") String prescriptionId); @PutMapping("/{id}") void update(@RequestHeader(Constants.GRANT_HEADER) PureGrant grant,
			@PathVariable("id") String prescriptionId, @RequestBody Prescription prescription);  }### Answer:
@Test void update() throws Exception { String prescriptionId = this.prescriptions.iterator().next(); HttpHeaders headers = new HttpHeaders(); headers.set(Constants.GRANT_HEADER, this.registeredPhysician.getGrant()); HttpEntity<?> entity = new HttpEntity<>(headers); ResponseEntity<Prescription> response; response = this.restTemplate.exchange("/prescriptions/" + prescriptionId, HttpMethod.GET, entity, Prescription.class); assertEquals(200, response.getStatusCodeValue()); Prescription prescription = response.getBody(); assertNotNull(prescription); String newNotes = "New notes"; Date newAssignDate = Utils.yesterday(); Date newReleaseDate = Utils.today(); prescription.setNotes(newNotes); prescription.setAssingDate(newAssignDate); prescription.setReleaseDate(newReleaseDate); entity = new HttpEntity<>(prescription, headers); response = this.restTemplate.exchange("/prescriptions/" + prescriptionId, HttpMethod.PUT, entity, Prescription.class); assertEquals(200, response.getStatusCodeValue()); entity = new HttpEntity<>(headers); response = this.restTemplate.exchange("/prescriptions/" + prescriptionId, HttpMethod.GET, entity, Prescription.class); assertEquals(200, response.getStatusCodeValue()); Prescription updatedPrescription = response.getBody(); assertNotNull(updatedPrescription); assertEquals(newNotes, updatedPrescription.getNotes()); assertEquals(newAssignDate, updatedPrescription.getAssingDate()); assertEquals(newReleaseDate, updatedPrescription.getReleaseDate()); this.mockMvc .perform(MockMvcRequestBuilders.request(HttpMethod.PUT, "/prescriptions/" + prescriptionId) .content(jackson2ObjectMapper.writeValueAsString(prescription)) .header(Constants.GRANT_HEADER, this.registeredPhysician.getGrant()) .header(HttpHeaders.CONTENT_TYPE, "application/json")) .andDo(document("prescription/update", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint()))); }