@Test public void shouldGetListOfUploadsSupported() throws Exception { ResponseEntity<OpenLmisResponse> responseEntity = controller.getSupportedUploads(); Map<String, UploadBean> result = (Map<String, UploadBean>) responseEntity.getBody().getData().get("supportedUploads"); assertThat(result.size(), is(uploadBeansMap.size())); }
@RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") public ResponseEntity<OpenLmisResponse> getSupportedUploads() { HashMap<String, UploadBean> beanDefinitions = new HashMap<>(); for(String key :uploadBeansMap.keySet()){ UploadBean proxy = uploadBeansMap.get(key); UploadBean bean = new UploadBean(); bean.setDisplayName(proxy.getDisplayName()); beanDefinitions.put(key,bean); } return response(SUPPORTED_UPLOADS, beanDefinitions); }
UploadController extends BaseController { @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") public ResponseEntity<OpenLmisResponse> getSupportedUploads() { HashMap<String, UploadBean> beanDefinitions = new HashMap<>(); for(String key :uploadBeansMap.keySet()){ UploadBean proxy = uploadBeansMap.get(key); UploadBean bean = new UploadBean(); bean.setDisplayName(proxy.getDisplayName()); beanDefinitions.put(key,bean); } return response(SUPPORTED_UPLOADS, beanDefinitions); } }
UploadController extends BaseController { @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") public ResponseEntity<OpenLmisResponse> getSupportedUploads() { HashMap<String, UploadBean> beanDefinitions = new HashMap<>(); for(String key :uploadBeansMap.keySet()){ UploadBean proxy = uploadBeansMap.get(key); UploadBean bean = new UploadBean(); bean.setDisplayName(proxy.getDisplayName()); beanDefinitions.put(key,bean); } return response(SUPPORTED_UPLOADS, beanDefinitions); }  }
UploadController extends BaseController { @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") public ResponseEntity<OpenLmisResponse> getSupportedUploads() { HashMap<String, UploadBean> beanDefinitions = new HashMap<>(); for(String key :uploadBeansMap.keySet()){ UploadBean proxy = uploadBeansMap.get(key); UploadBean bean = new UploadBean(); bean.setDisplayName(proxy.getDisplayName()); beanDefinitions.put(key,bean); } return response(SUPPORTED_UPLOADS, beanDefinitions); }  @RequestMapping(value = "/upload", method = POST) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") ResponseEntity<OpenLmisResponse> upload(MultipartFile csvFile, String model, HttpServletRequest request); @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") ResponseEntity<OpenLmisResponse> getSupportedUploads(); }
UploadController extends BaseController { @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") public ResponseEntity<OpenLmisResponse> getSupportedUploads() { HashMap<String, UploadBean> beanDefinitions = new HashMap<>(); for(String key :uploadBeansMap.keySet()){ UploadBean proxy = uploadBeansMap.get(key); UploadBean bean = new UploadBean(); bean.setDisplayName(proxy.getDisplayName()); beanDefinitions.put(key,bean); } return response(SUPPORTED_UPLOADS, beanDefinitions); }  @RequestMapping(value = "/upload", method = POST) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") ResponseEntity<OpenLmisResponse> upload(MultipartFile csvFile, String model, HttpServletRequest request); @RequestMapping(value = "/supported-uploads", method = GET, headers = ACCEPT_JSON) @PreAuthorize("@permissionEvaluator.hasPermission(principal,'UPLOADS')") ResponseEntity<OpenLmisResponse> getSupportedUploads(); static final String SELECT_UPLOAD_TYPE; static final String INCORRECT_FILE; static final String FILE_IS_EMPTY; static final String INCORRECT_FILE_FORMAT; static final String UPLOAD_FILE_SUCCESS; static final String SUCCESS; static final String ERROR; static final String SUPPORTED_UPLOADS; }