ShowRevisionInfoController extends AbstractTemplateController { @Override protected ModelAndView svnHandle(final SVNConnection connection, final BaseCommand command, final long headRevision, final UserRepositoryContext userRepositoryContext, final HttpServletRequest request, final HttpServletResponse response, final BindException exception) throws Exception { final long revisionNumber = command.getRevisionNumber(); logger.debug("Getting revision info details for revision: " + revisionNumber); final LogEntry logEntry = getRepositoryService().getLogEntry(connection, command.getName(), revisionNumber); final Map<String, Object> model = new HashMap<String, Object>(); model.put("revisionInfo", logEntry); return new ModelAndView(getViewName(), model); }    }
@Test public void testSvnHandle() throws Exception { final RepositoryService mockService = EasyMock.createMock(RepositoryService.class); final BaseCommand command = new BaseCommand(); command.setPath("trunk/test"); command.setName(new RepositoryName("test")); command.setRevision(Revision.create(12)); final ShowRevisionInfoController ctrl = new ShowRevisionInfoController(); ctrl.setRepositoryService(mockService); expect(mockService.getLogEntry(null, command.getName(), command.getRevisionNumber())).andStubReturn(TestUtils.getLogEntryStub()); replay(mockService); final ModelAndView modelAndView = ctrl.svnHandle(null, command, 100, null, null, null, null); final Map model = modelAndView.getModel(); verify(mockService); assertEquals(1, model.size()); final LogEntry revision = (LogEntry) model.get("revisionInfo"); assertEquals(123, revision.getRevision()); }