@Test public void testRemoveRiskTypeDictionary() { jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"name\":\"Test\"}}"; try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) { when(request.getReader()).thenReturn(br); controller.removeRiskTypeDictionary(request, response); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("riskTypeDictionaryDatas")); } catch (Exception e) { logger.error("Exception" + e); } }
@RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) public void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, riskTypeDatas, RiskType.class); }
SafePolicyController { @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) public void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, riskTypeDatas, RiskType.class); } }
SafePolicyController { @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) public void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, riskTypeDatas, RiskType.class); } @Autowired  SafePolicyController(CommonClassDao commonClassDao);  SafePolicyController(); }
SafePolicyController { @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) public void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, riskTypeDatas, RiskType.class); } @Autowired  SafePolicyController(CommonClassDao commonClassDao);  SafePolicyController(); void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_RiskTypeDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRiskTypeDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_RiskTypeData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRiskTypeDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/save_riskType"}, method = {RequestMethod.POST}) ModelAndView saveRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_SafePolicyWarningDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSafePolicyWarningEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_SafePolicyWarningData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSafePolicyWarningeEntityData(HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/save_safePolicyWarning"}, method = {RequestMethod.POST}) ModelAndView saveSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/remove_SafePolicyWarning"}, method = {RequestMethod.POST}) void removeSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response); }
SafePolicyController { @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) public void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, riskTypeDatas, RiskType.class); } @Autowired  SafePolicyController(CommonClassDao commonClassDao);  SafePolicyController(); void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_RiskTypeDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRiskTypeDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_RiskTypeData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRiskTypeDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/save_riskType"}, method = {RequestMethod.POST}) ModelAndView saveRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/remove_riskType"}, method = {RequestMethod.POST}) void removeRiskTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_SafePolicyWarningDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSafePolicyWarningEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_SafePolicyWarningData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSafePolicyWarningeEntityData(HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/save_safePolicyWarning"}, method = {RequestMethod.POST}) ModelAndView saveSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/sp_dictionary/remove_SafePolicyWarning"}, method = {RequestMethod.POST}) void removeSafePolicyWarningDictionary(HttpServletRequest request, HttpServletResponse response);  }