OptimizationDictionaryController { @RequestMapping( value = {"/get_OptimizationModelsData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) public void getOptimizationModelsDictionaryEntityData(HttpServletResponse response) { DictionaryUtils dUtils = getDictionaryUtilsInstance(); dUtils.getData(response, optimizationModelsDictionaryDatas, OptimizationModels.class); } OptimizationDictionaryController(); @Autowired  OptimizationDictionaryController(CommonClassDao commonClassDao); static void setCommonClassDao(CommonClassDao commonClassDao); @RequestMapping( value = {"/get_OptimizationModelsData"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOptimizationModelsDictionaryEntityData(HttpServletResponse response); @RequestMapping( value = {"/get_OptimizationModelsDataByName"}, method = {RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getOptimizationModelsDictionaryByNameEntityData(HttpServletResponse response); @RequestMapping(value = {"/oof_dictionary/save_model"}, method = {RequestMethod.POST}) ModelAndView saveOptimizationModelsDictionary(HttpServletRequest request, HttpServletResponse response); @RequestMapping(value = {"/oof_dictionary/remove_model"}, method = {RequestMethod.POST}) void removeOptimizationModelsDictionary(HttpServletRequest request, HttpServletResponse response);  }
@Test public void testGetOptimizationModelsDictionaryEntityData() { logger.info("testGetOptimizationModelsDictionaryEntityData: Entering"); MockHttpServletResponse response = new MockHttpServletResponse(); String modelJson = "{\"optimizationModelsDictionaryData\":[\"modelName\"]}"; BufferedReader br = new BufferedReader(new StringReader(modelJson)); request = mock(HttpServletRequest.class); try { when(request.getReader()).thenReturn(br); controller.getOptimizationModelsDictionaryEntityData(response); logger.info("response.getContentAsString(): " + response.getContentAsString()); assertTrue(response.getContentAsString() != null && response.getContentAsString().contains("optimizationModelsDictionaryDatas")); } catch (Exception e) { fail("Exception: " + e); } logger.info("testGetOptimizationModelsDictionaryEntityData: exit"); }