CreateDcaeMicroServiceController extends RestrictedBaseController { @RequestMapping( value = {"/get_DCAEPriorityValues"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) public void getDCAEPriorityValuesData(HttpServletRequest request, HttpServletResponse response) { try { Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); List<String> priorityList = new ArrayList<>(); priorityCount = 10; for (int i = 1; i < priorityCount; i++) { priorityList.add(String.valueOf(i)); } model.put("priorityDatas", mapper.writeValueAsString(priorityList)); response.getWriter().write(new JSONObject(new JsonMessage(mapper.writeValueAsString(model))).toString()); } catch (Exception e) { LOGGER.error(e); } } @Autowired private  CreateDcaeMicroServiceController(CommonClassDao commonClassDao);  CreateDcaeMicroServiceController(); static CommonClassDao getCommonClassDao(); static void setCommonClassDao(CommonClassDao commonClassDao); PolicyRestAdapter setDataToPolicyRestAdapter(PolicyRestAdapter policyData, JsonNode root); boolean checkPattern(String patternString); void constructRule(StringBuilder sb, String jsonNode, Map<String, String> sigRules2); void parseData(JsonNode jsonNode, String string); String removeNullAttributes(String cleanJson); JsonArray removeNull(JsonArray array); JsonObject removeNull(JsonObject obj); String cleanUpJson(String json); JSONObject decodeContent(JsonNode jsonNode); @RequestMapping( value = {"/policyController/getDCAEMSTemplateData.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) ModelAndView getDCAEMSTemplateData(HttpServletRequest request, HttpServletResponse response); JSONObject convertToArrayElement(JSONObject json, String keyValue); Set<String> getManyTrueProperties(String referAttributes); @RequestMapping( value = {"/policyController/getModelServiceVersioneData.htm"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) ModelAndView getModelServiceVersionData(HttpServletRequest request, HttpServletResponse response); @RequestMapping( value = {"/get_DCAEPriorityValues"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET}, produces = MediaType.APPLICATION_JSON_VALUE) void getDCAEPriorityValuesData(HttpServletRequest request, HttpServletResponse response); void prePopulateDCAEMSPolicyData(PolicyRestAdapter policyAdapter, PolicyEntity entity); Map<String, String> convert(String str, String split); @SuppressWarnings("unchecked") void readFile(PolicyRestAdapter policyAdapter, PolicyEntity entity); @SuppressWarnings({"rawtypes", "unchecked"}) void readRecursivlyJSONContent(Map<String, ?> map, Map<String, Object> data); String getPolicyScope(String value); Map<String, String> convertMap(Map<String, String> attributesMap, Map<String, String> attributesRefMap); @RequestMapping( value = {"/ms_dictionary/set_MSModelData"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST}) void SetMSModelData(HttpServletRequest request, HttpServletResponse response); void cleanUp(String path); void checkZipDirectory(String zipDirectory); Map<String, String> getAttributesListRefMap(); Map<String, LinkedList<String>> getArrayTextList(); Map<String, String> getSigRules(); void setSigRules(Map<String, String> sigRules); static final String DATATYPE; static final String PROPERTIES; static final String TYPE; static final String STRING; static final String INTEGER; static final String LIST; static final String DEFAULT; static final String REQUIRED; static final String MATCHABLE; static final String MANYFALSE; }
@Test public void testGetDcaePriorityValuesData() { logger.debug("testGetDCAEPriorityValuesData: enter"); CreateDcaeMicroServiceController controller = new CreateDcaeMicroServiceController(); MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); try { controller.getDCAEPriorityValuesData(request, response); assertTrue( response.getContentAsString() != null && response.getContentAsString().contains("priorityDatas")); logger.debug("response: " + response.getContentAsString()); } catch (Exception e) { logger.error("testGetDCAEPriorityValuesData", e); fail("testGetDCAEPriorityValuesData failed due to: " + e); } logger.debug("testGetDCAEPriorityValuesData: exit"); }