ConfigurationController { @RequestMapping(value = {"/advanced"}, method = RequestMethod.POST) public View updateOptions(AdvancedForm form, RedirectAttributes redirectAttributes) { boolean syncDeletes = form.isSyncDeletes(); log.debug("updating sync deletes to : {}", syncDeletes); this.syncConfigurationManager.setSyncDeletes(syncDeletes); String up = form.getUpdatePolicy(); log.debug("modifying update policy to {}", up); UpdatePolicyHelper.set(this.syncConfigurationManager, UpdatePolicy.valueOf(up)); boolean jumpstart = form.isJumpStart(); log.debug("updating jump start to : {}", jumpstart); this.syncConfigurationManager.setJumpStart(jumpstart); return createConfigUpdatedRedirectView(redirectAttributes); } @Autowired  ConfigurationController(
        SyncConfigurationManager syncConfigurationManager,
        SyncProcessManager syncProcessManager,
        SyncOptimizeManager syncOptimizeManager); @ModelAttribute("directoryConfigs") DirectoryConfigs directoryConfigs(); @ModelAttribute("duracloudConfiguration") DuracloudConfiguration duracloudConfiguration(); @ModelAttribute("duracloudCredentialsForm") DuracloudCredentialsForm duracloudCredentials(); @ModelAttribute("maxFileSizeForm") MaxFileSizeForm maxFileSizeForm(); @ModelAttribute("modeForm") ModeForm modeForm(); @ModelAttribute("syncProcessState") SyncProcessState syncProcessState(); @ModelAttribute("advancedForm") AdvancedForm advancedForm(); @RequestMapping(value = {""}, method = RequestMethod.GET) String get(Model model); @RequestMapping(value = {"/remove"}, method = RequestMethod.POST) View removeDirectory(@Valid DirectoryConfigForm directoryConfigForm,
                                RedirectAttributes redirectAttributes); @RequestMapping(value = {"/advanced"}, method = RequestMethod.POST) View updateOptions(AdvancedForm form, RedirectAttributes redirectAttributes); @RequestMapping(value = {"/mode"}, method = RequestMethod.POST) View updateMode(ModeForm form, RedirectAttributes redirectAttributes); @RequestMapping(value = {"/max-file-size"}, method = RequestMethod.POST) View updateMaxFileSize(MaxFileSizeForm form, RedirectAttributes redirectAttributes); @ModelAttribute("threadCountForm") ThreadCountForm threadCountForm(); @ModelAttribute("syncOptimizeManager") SyncOptimizeManager syncOptimizeManager(); @RequestMapping(value = {"/thread-count"}, method = RequestMethod.POST) View updateThreadCount(ThreadCountForm form, RedirectAttributes redirectAttributes); @ModelAttribute("directoryConfigForm") DirectoryConfigForm directoryConfigForm(); @RequestMapping(value = {"/add"}, method = RequestMethod.GET) String getAdd(); @RequestMapping(value = {"/add"}, method = RequestMethod.POST) View add(@Valid DirectoryConfigForm directoryConfigForm,
                    RedirectAttributes redirectAttributes); @ModelAttribute("prefixForm") PrefixForm prefixForm(); @RequestMapping(value = {"/prefix"}, method = RequestMethod.POST) View updatePrefix(PrefixForm form, RedirectAttributes redirectAttributes); @RequestMapping(value = {"/optimize"}, method = RequestMethod.GET) String optimize(); @RequestMapping(value = {"/optimize"}, method = RequestMethod.POST) View optimize(@RequestParam(value = "autoStart", defaultValue = "false") final boolean autoStart,
                         RedirectAttributes redirectAttributes); static final String CONFIGURATION_MAPPING; }
@Test public void testUpdateOptions() { AdvancedForm f = createMock(AdvancedForm.class); EasyMock.expect(f.isSyncDeletes()).andReturn(true); EasyMock.expect(f.isJumpStart()).andReturn(false); EasyMock.expect(f.getUpdatePolicy()).andReturn(UpdatePolicy.PRESERVE.name()); syncConfigurationManager.setSyncDeletes(EasyMock.anyBoolean()); EasyMock.expectLastCall().once(); syncConfigurationManager.setRenameUpdates(true); EasyMock.expectLastCall().once(); syncConfigurationManager.setSyncUpdates(true); EasyMock.expectLastCall().once(); syncConfigurationManager.setJumpStart(false); EasyMock.expectLastCall().once(); replay(); configurationController.updateOptions(f, new RedirectAttributesModelMap()); }