@Test public void testRemoveOnapDictionary() { logger.info("testRemoveOnapDictionary: Entering"); MockHttpServletResponse response = new MockHttpServletResponse(); request = mock(HttpServletRequest.class); try { jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"onapName\":\"Test\"}}"; BufferedReader br = new BufferedReader(new StringReader(jsonString)); when(request.getReader()).thenReturn(br); controller.removeOnapDictionary(request, response); logger.info("response.getContentAsString(): " + response.getContentAsString()); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("onapNameDictionaryDatas")); } catch (Exception e) { fail("Exception: " + e); } logger.info("testRemoveOnapDictionary: exit"); }
@RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) public void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, onapNameDatas, OnapName.class); }
DictionaryController { @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) public void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, onapNameDatas, OnapName.class); } }
DictionaryController { @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) public void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, onapNameDatas, OnapName.class); } @Autowired  DictionaryController(CommonClassDao commonClassDao);  DictionaryController(); }
DictionaryController { @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) public void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, onapNameDatas, OnapName.class); } @Autowired  DictionaryController(CommonClassDao commonClassDao);  DictionaryController(); @RequestMapping( value = {"/get_AttributeDatabyAttributeName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getAttributeDictionaryEntityDatabyAttributeName(HttpServletResponse response); @RequestMapping( value = "/get_AttributeData", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) void getAttributeDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/attribute_dictionary/save_attribute"}, method = {RequestMethod.POST}) ModelAndView saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/attribute_dictionary/remove_attribute"}, method = {RequestMethod.POST}) void removeAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_OnapNameDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOnapNameDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_OnapNameData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOnapNameDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/onap_dictionary/save_onapName"}, method = {RequestMethod.POST}) ModelAndView saveOnapDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response); }
DictionaryController { @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) public void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, onapNameDatas, OnapName.class); } @Autowired  DictionaryController(CommonClassDao commonClassDao);  DictionaryController(); @RequestMapping( value = {"/get_AttributeDatabyAttributeName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getAttributeDictionaryEntityDatabyAttributeName(HttpServletResponse response); @RequestMapping( value = "/get_AttributeData", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) void getAttributeDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/attribute_dictionary/save_attribute"}, method = {RequestMethod.POST}) ModelAndView saveAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/attribute_dictionary/remove_attribute"}, method = {RequestMethod.POST}) void removeAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_OnapNameDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOnapNameDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_OnapNameData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOnapNameDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/onap_dictionary/save_onapName"}, method = {RequestMethod.POST}) ModelAndView saveOnapDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/onap_dictionary/remove_onap"}, method = {RequestMethod.POST}) void removeOnapDictionary(HttpServletRequest request, HttpServletResponse response);  }