@Test public void shouldGetAllSettings() throws Exception { ArrayList<ConfigurationSetting> configSettingList = new ArrayList<ConfigurationSetting>(); ConfigurationSetting setting = new ConfigurationSetting(); setting.setKey("123"); configSettingList.add(setting); when(configurationService.getConfigurations()).thenReturn(configSettingList); controller.getAll(); verify(configurationService).getConfigurations(); }
@RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") public ResponseEntity<OpenLmisResponse> getAll() { ConfigurationDTO dto = new ConfigurationDTO(); dto.setList( configurationService.getConfigurations() ); return OpenLmisResponse.response(SETTINGS, dto ); }
SettingController extends BaseController { @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") public ResponseEntity<OpenLmisResponse> getAll() { ConfigurationDTO dto = new ConfigurationDTO(); dto.setList( configurationService.getConfigurations() ); return OpenLmisResponse.response(SETTINGS, dto ); } }
SettingController extends BaseController { @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") public ResponseEntity<OpenLmisResponse> getAll() { ConfigurationDTO dto = new ConfigurationDTO(); dto.setList( configurationService.getConfigurations() ); return OpenLmisResponse.response(SETTINGS, dto ); }  }
SettingController extends BaseController { @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") public ResponseEntity<OpenLmisResponse> getAll() { ConfigurationDTO dto = new ConfigurationDTO(); dto.setList( configurationService.getConfigurations() ); return OpenLmisResponse.response(SETTINGS, dto ); }  @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(value = "/settings/{key}", method = RequestMethod.GET, headers = "Accept=application/json") ResponseEntity<OpenLmisResponse> getByKey(@PathVariable(value = "key") String key); @RequestMapping(value = "/saveSettings", method = RequestMethod.POST, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") ResponseEntity<OpenLmisResponse> updateSettings(@RequestBody ConfigurationDTO settings); }
SettingController extends BaseController { @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") public ResponseEntity<OpenLmisResponse> getAll() { ConfigurationDTO dto = new ConfigurationDTO(); dto.setList( configurationService.getConfigurations() ); return OpenLmisResponse.response(SETTINGS, dto ); }  @RequestMapping(value = "/settings", method = RequestMethod.GET, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") ResponseEntity<OpenLmisResponse> getAll(); @RequestMapping(value = "/settings/{key}", method = RequestMethod.GET, headers = "Accept=application/json") ResponseEntity<OpenLmisResponse> getByKey(@PathVariable(value = "key") String key); @RequestMapping(value = "/saveSettings", method = RequestMethod.POST, headers = "Accept=application/json") @PreAuthorize("@permissionEvaluator.hasPermission(principal,'MANAGE_SETTING')") ResponseEntity<OpenLmisResponse> updateSettings(@RequestBody ConfigurationDTO settings); static final String SETTINGS; }