### Question:
RadiologyOrderFormController { @RequestMapping(method = RequestMethod.GET, params = "patientId") protected ModelAndView getRadiologyOrderFormWithNewRadiologyOrderAndPrefilledPatient(@RequestParam("patientId") Patient patient) { final ModelAndView modelAndView = getRadiologyOrderFormWithNewRadiologyOrder(); final Order order = (Order) modelAndView.getModel() .get("radiologyOrder"); order.setPatient(patient); modelAndView.addObject("patientId", patient.getPatientId()); return modelAndView; }   static final String RADIOLOGY_ORDER_FORM_REQUEST_MAPPING; }### Answer:
@Test public void getRadiologyOrderFormWithNewRadiologyOrderAndPrefilledPatient_shouldPopulateModelAndViewWithNewRadiologyOrderPrefilledWithGivenPatient() throws Exception { Patient mockPatient = RadiologyTestData.getMockPatient1(); ModelAndView modelAndView = radiologyOrderFormController.getRadiologyOrderFormWithNewRadiologyOrderAndPrefilledPatient(mockPatient); assertNotNull(modelAndView); assertThat(modelAndView.getViewName(), is(RadiologyOrderFormController.RADIOLOGY_ORDER_CREATION_FORM_VIEW)); assertThat(modelAndView.getModelMap(), hasKey("radiologyOrder")); RadiologyOrder order = (RadiologyOrder) modelAndView.getModelMap() .get("radiologyOrder"); assertNull(order.getOrderId()); assertNotNull(order.getStudy()); assertNull(order.getStudy() .getStudyId()); assertNotNull(order.getPatient()); assertThat(order.getPatient(), is(mockPatient)); assertThat(modelAndView.getModelMap(), hasKey("patientId")); Integer patientId = (Integer) modelAndView.getModelMap() .get("patientId"); assertThat(patientId, is(mockPatient.getPatientId())); }