StatusController { @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"stop"}) public View stop() { this.syncProcessManager.stop(); return redirectTo(StatusController.STATUS_MAPPING); } @Autowired  StatusController(SyncProcessManager syncProcessManager,
                            SyncConfigurationManager syncConfigurationManager,
                            SyncOptimizeManager syncOptimizeManager); @RequestMapping(value = {""}) String get(@RequestParam(required = false, defaultValue = "queued") String statusTab, Model model); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"start"}) View start(); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"pause"}) View pause(); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"resume"}) View resume(); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"stop"}) View stop(); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"restart"}) View restart(); @RequestMapping(value = {""}, method = RequestMethod.POST, params = {"clear-failures"}) View clearErrors(); @ModelAttribute SyncProcessStats syncProcessStats(); @ModelAttribute SyncOptimizeManager syncOptimizeManager(); @ModelAttribute SyncProcessState syncProcessState(); @ModelAttribute("currentError") SyncProcessError currentError(); @ModelAttribute("monitoredFiles") List<MonitoredFile> monitoredFiles(); @ModelAttribute("failures") List<SyncSummary> failures(); @ModelAttribute("recentlyCompleted") List<SyncSummary> recentlyCompleted(); @ModelAttribute("queuedFiles") List<File> queuedFiles(); @ModelAttribute("fileSizeFormatter") FileSizeFormatter fileSizeFormatter(); static final String STATUS_MAPPING; static final String ACTIVE_UPLOADS_KEY; }
@Test public void testStop() { syncProcessManager.stop(); EasyMock.expectLastCall().once(); replay(); View v = statusController.stop(); Assert.assertNotNull(v); }