@Test public void testRemoveRainyDayDictionary() { logger.info("testRemoveRainyDayDictionary: Entering"); MockHttpServletResponse response = new MockHttpServletResponse(); request = mock(HttpServletRequest.class); try { jsonString = "{\"data\": {\"modelName\": \"test\",\"inprocess\": false,\"model\": {\"name\": \"testingdata\", " + " \"subScopename\": \"\",\"path\": [],\"type\": \"dir\",\"size\": 0," + "\"date\": \"2017-04-12T21:26:57.000Z\",\"version\": \"\",\"createdBy\": " + "\"someone\",\"modifiedBy\": \"someone\",\"content\": \"\",\"recursive\": false}," + " \"tempModel\": {\"name\": \"testingdata\",\"subScopename\": \"\"}," + " \"policy\": {\"policyType\": \"Config\",\"configPolicyType\": \"Micro Service\"," + "\"policyName\": \"may1501\",\"policyDescription\": \"testing input\"," + "\"ecompName\": \"RaviTest\",\"guard\": \"False\",\"riskType\": \"Risk12345\"," + "\"riskLevel\": \"2\",\"priority\": \"6\",\"serviceType\": \"DkatPolicyBody\"," + "\"version\": \"1707.41.02\",\"ruleGridData\": [[\"fileId\"]],\"ttlDate\": null}}," + "\"policyJSON\": {\"pmTableName\": \"test\",\"dmdTopic\": \"1\",\"fileId\": \"56\"}}"; BufferedReader br = new BufferedReader(new StringReader(jsonString)); when(request.getReader()).thenReturn(br); controller.removeRainyDayDictionary(request, response); logger.info("response.getContentAsString(): " + response.getContentAsString()); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("rainyDayDictionaryDatas")); } catch (Exception e) { logger.error("Exception Occured" + e); fail("Exception: " + e); } logger.info("testRemoveRainyDayDictionary: exit"); }
@RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) public void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, rainDayDatas, RainyDayTreatments.class); }
DecisionPolicyDictionaryController { @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) public void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, rainDayDatas, RainyDayTreatments.class); } }
DecisionPolicyDictionaryController { @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) public void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, rainDayDatas, RainyDayTreatments.class); } @Autowired  DecisionPolicyDictionaryController(CommonClassDao commonClassDao);  DecisionPolicyDictionaryController(); }
DecisionPolicyDictionaryController { @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) public void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, rainDayDatas, RainyDayTreatments.class); } @Autowired  DecisionPolicyDictionaryController(CommonClassDao commonClassDao);  DecisionPolicyDictionaryController(); @RequestMapping( value = {"/get_SettingsDictionaryDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSettingsDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_SettingsDictionaryData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSettingsDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/save_Settings"}, method = {RequestMethod.POST}) ModelAndView saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/settings_dictionary/remove_settings"}, method = {RequestMethod.POST}) void removeSettingsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_RainyDayDictionaryDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRainyDayDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_RainyDayDictionaryData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRainyDayDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/save_RainyDay"}, method = {RequestMethod.POST}) ModelAndView saveRainyDayDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response); }
DecisionPolicyDictionaryController { @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) public void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, rainDayDatas, RainyDayTreatments.class); } @Autowired  DecisionPolicyDictionaryController(CommonClassDao commonClassDao);  DecisionPolicyDictionaryController(); @RequestMapping( value = {"/get_SettingsDictionaryDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSettingsDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_SettingsDictionaryData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getSettingsDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/save_Settings"}, method = {RequestMethod.POST}) ModelAndView saveSettingsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/settings_dictionary/remove_settings"}, method = {RequestMethod.POST}) void removeSettingsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_RainyDayDictionaryDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRainyDayDictionaryByNameEntityData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_RainyDayDictionaryData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getRainyDayDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/save_RainyDay"}, method = {RequestMethod.POST}) ModelAndView saveRainyDayDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/decision_dictionary/remove_rainyDay"}, method = {RequestMethod.POST}) void removeRainyDayDictionary(HttpServletRequest request, HttpServletResponse response);  }