DocumentationController { @RequestMapping(value = DOC_URI, method = RequestMethod.GET) public String doc(ModelMap modelMap) { modelMap.put(DOC_OBJ, this.geosupportService.getDocumentation()); Version version = this.geosupportService.version(); modelMap.addAttribute(VERSION_OBJ, version); logger.debug("Returning Version instance {} to view named {}", version, DOC_VIEW_NAME); return DOC_VIEW_NAME; }  @RequestMapping(value = DOC_URI, method = RequestMethod.GET) String doc(ModelMap modelMap); void setGeosupportService(GeosupportService geosupportService); static final String DOC_OBJ; static final String DOC_URI; static final String DOC_VIEW_NAME; static final String VERSION_OBJ; }
@Test public void testDoc() { Documentation doc = new Documentation(); ModelMap modelMap = new ModelMap(); Mockito.when(this.geosupportServiceMock.getDocumentation()).thenReturn(doc); Version version = new Version(); Mockito.when(this.geosupportServiceMock.version()).thenReturn(version); assertEquals(DocumentationController.DOC_VIEW_NAME, this.documentationController.doc(modelMap)); assertSame(version, modelMap.getAttribute("version")); assertSame(doc, modelMap.get("doc")); }