	@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;

		// Get prescription
		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);

		// Update prescription
		entity = new HttpEntity<>(prescription, headers);
		response = this.restTemplate.exchange("/prescriptions/" + prescriptionId, HttpMethod.PUT, entity,
				Prescription.class);
		assertEquals(200, response.getStatusCodeValue());

		// Verify prescription
		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());

		// Document REST
		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())));
	}