PolicyScopeDictionaryController { @RequestMapping(value = {"/ps_dictionary/remove_PSClosedLoop"}, method = {RequestMethod.POST}) public void removePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response) throws IOException { DictionaryUtils utils = getDictionaryUtilsInstance(); utils.removeData(request, response, psCLDatas, PolicyScopeClosedLoop.class); } PolicyScopeDictionaryController(); @Autowired  PolicyScopeDictionaryController(CommonClassDao commonClassDao); void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_GroupPolicyScopeDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getGroupPolicyScopeEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_GroupPolicyScopeData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getGroupPolicyScopeEntityData(HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/save_psGroupPolicyScope"}, method = {RequestMethod.POST}) ModelAndView savePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/remove_GroupPolicyScope"}, method = {RequestMethod.POST}) void removePSGroupScopeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_PSClosedLoopDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSClosedLoopEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_PSClosedLoopData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSClosedLoopEntityData(HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/save_psClosedLoop"}, method = {RequestMethod.POST}) ModelAndView savePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/remove_PSClosedLoop"}, method = {RequestMethod.POST}) void removePSClosedLoopDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_PSServiceDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSServiceEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_PSServiceData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSServiceEntityData(HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/save_psService"}, method = {RequestMethod.POST}) ModelAndView savePSServiceDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/remove_PSService"}, method = {RequestMethod.POST}) void removePSServiceDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_PSTypeDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSTypeEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_PSTypeData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSTypeEntityData(HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/save_psType"}, method = {RequestMethod.POST}) ModelAndView savePSTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/remove_PSType"}, method = {RequestMethod.POST}) void removePSTypeDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_PSResourceDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSResourceEntityDataByName(HttpServletResponse response); @RequestMapping( value = {"/get_PSResourceData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getPSResourceEntityData(HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/save_psResource"}, method = {RequestMethod.POST}) ModelAndView savePSResourceDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/ps_dictionary/remove_PSResource"}, method = {RequestMethod.POST}) void removePSResourceDictionary(HttpServletRequest request, HttpServletResponse response);  }
@Test public void testRemovePSClosedLoopDictionary() { jsonString = "{\"userid\":\"demo\",\"data\":{\"id\":1,\"description\":\"test\",\"name\":\"Test\"}}"; try (BufferedReader br = new BufferedReader(new StringReader(jsonString))) { when(request.getReader()).thenReturn(br); controller.removePSClosedLoopDictionary(request, response); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("psClosedLoopDictionaryDatas")); } catch (Exception e) { logger.error("Exception" + e); } }