+ @Test
+ public void getMicroServiceDictNameDictionaryEntityData() {
+ logger.info("getMicroServiceDictNameDictionaryEntityData: Entering");
+
+ MockHttpServletResponse response = new MockHttpServletResponse();
+ String msModelJson = "{\"microServiceDictionaryData\":[\"modelName\"]}";
+
+ BufferedReader br = new BufferedReader(new StringReader(msModelJson));
+ request = mock(HttpServletRequest.class);
+
+ try {
+ when(request.getReader()).thenReturn(br);
+ controller.getMicroServiceDictNameDictionaryEntityData(response);
+ logger.info("response.getContentAsString(): " + response.getContentAsString());
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("microServiceDictionaryData"));
+
+ } catch (Exception e) {
+ fail("Exception: " + e);
+ }
+
+ logger.info("getMicroServiceDictNameDictionaryEntityData: exit");
+ }
+
+ @Test
+ public void testSaveDictionaryData() {
+ logger.info("testSaveDictionaryData: Entering");
+
+ MockHttpServletResponse response = new MockHttpServletResponse();
+ request = mock(HttpServletRequest.class);
+
+ try {
+ jsonString = "{\"microServiceDictionaryDatas\": {\"id\": 1,\"dictionaryName\": \"tes1t\","
+ + "\"dictionaryUrl\": \"tes1t\",\"dictionaryDataByName\": \"test\"}}";
+ BufferedReader br = new BufferedReader(new StringReader(jsonString));
+ when(request.getReader()).thenReturn(br);
+ controller.saveDictionaryData(request, response);
+ logger.info("response.getContentAsString(): " + response.getContentAsString());
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("microServiceDictionaryDatas"));
+ } catch (Exception e) {
+ fail("Exception: " + e);
+ }
+ logger.info("testSaveDictionaryData: exit");
+ }