LatenessDormancyController { @RequestMapping(method = RequestMethod.GET) @ModelAttribute("formBean") public LatenessDormancyFormBean showPopulatedForm() { ProductConfigurationDto productConfiguration = adminServiceFacade.retrieveProductConfiguration(); LatenessDormancyFormBean formBean = new LatenessDormancyFormBean(); formBean.setLatenessDays(productConfiguration.getLatenessDays()); formBean.setDormancyDays(productConfiguration.getDormancyDays()); return formBean; } protected  LatenessDormancyController();  LatenessDormancyController(final AdminServiceFacade adminServiceFacade); @ModelAttribute("breadcrumbs") List<BreadCrumbsLinks> showBreadCrumbs(); @RequestMapping(method = RequestMethod.GET) @ModelAttribute("formBean") LatenessDormancyFormBean showPopulatedForm(); @RequestMapping(method = RequestMethod.POST) String processFormSubmit(@RequestParam(value = CANCEL_PARAM, required = false) String cancel,
                                    @Valid @ModelAttribute("formBean") LatenessDormancyFormBean formBean,
                                    BindingResult result,
                                    SessionStatus status);  }
@Test public void shouldReturnedPopulatedForm() throws Exception { LatenessDormancyFormBean expectedFormBean = new LatenessDormancyFormBean(); expectedFormBean.setLatenessDays(1); expectedFormBean.setDormancyDays(1); when(adminServiceFacade.retrieveProductConfiguration()).thenReturn(new ProductConfigurationDto(1,1)); LatenessDormancyFormBean returnedFormBean = latenessDormancyController.showPopulatedForm(); Assert.assertThat(returnedFormBean, is(expectedFormBean)); Mockito.verify(adminServiceFacade).retrieveProductConfiguration(); }