MicroServiceDictionaryController { @RequestMapping(value = {"/ms_dictionary/remove_modelAttribute"}, method = {RequestMethod.POST}) public void removeMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, microServiceAttributeDatas, MicroServiceAttribute.class); } MicroServiceDictionaryController(); @Autowired  MicroServiceDictionaryController(CommonClassDao commonClassDao); static void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_DCAEUUIDDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getDCAEUUIDDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_DCAEUUIDData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getDCAEUUIDDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_dcaeUUID"}, method = {RequestMethod.POST}) ModelAndView saveDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_dcaeuuid"}, method = {RequestMethod.POST}) void removeDCAEUUIDDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceConfigNameDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceConfigNameByNameDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceConfigNameData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceConfigNameDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceDictData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceDictNameDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_DictionaryData"}, method = {RequestMethod.POST}) ModelAndView saveDictionaryData(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_msDictionaryData"}, method = {RequestMethod.POST}) void removeMicroServiceDictionaryData(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_configName"}, method = {RequestMethod.POST}) ModelAndView saveMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_msConfigName"}, method = {RequestMethod.POST}) void removeMicroServiceConfigNameDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceLocationDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceLocationByNameDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceLocationData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceLocationDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_location"}, method = {RequestMethod.POST}) ModelAndView saveMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_msLocation"}, method = {RequestMethod.POST}) void removeMicroServiceLocationDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceAttributeDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceAttributeByNameDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceAttributeData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceAttributeDictionaryEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_modelAttribute"}, method = {RequestMethod.POST}) ModelAndView saveMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_modelAttribute"}, method = {RequestMethod.POST}) void removeMicroServiceAttributeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceModelsDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceModelsDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceModelsDataByVersion"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceModelsDictionaryByVersionEntityData(HttpServletRequest request,
            HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceModelsData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceModelsDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceModelsDataServiceVersion"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceModelsDictionaryEntityDataServiceVersion(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceModelsDataByClass"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceModelsDictionaryClassEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_model"}, method = {RequestMethod.POST}) ModelAndView saveMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_msModel"}, method = {RequestMethod.POST}) void removeMicroServiceModelsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceHeaderDefaultsDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceHeaderDefaultsEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_MicroServiceHeaderDefaultsData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getMicroServiceHeaderDefaultsEntityData(HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/save_headerDefaults"}, method = {RequestMethod.POST}) ModelAndView saveMicroServiceHeaderDefaultValues(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ms_dictionary/remove_headerDefaults"}, method = {RequestMethod.POST}) void removeMicroServiceHeaderDefaults(HttpServletRequest request, HttpServletResponse response);  }
@Test public void testRemoveMicroServiceAttributeDictionary() { logger.info("testRemoveMicroServiceAttributeDictionary: 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\"," + "\"onapName\": \"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.removeMicroServiceAttributeDictionary(request, response); logger.info("response.getContentAsString(): " + response.getContentAsString()); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("microServiceAttributeDictionaryDatas")); } catch (Exception e) { fail("Exception: " + e); } logger.info("testRemoveMicroServiceAttributeDictionary: exit"); }