+
+ @Test
+ public void testRemoveMicroServiceDictionaryData() {
+ logger.info("testRemoveMicroServiceModelsDictionary: 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.removeMicroServiceDictionaryData(request, response);
+ logger.info("response.getContentAsString(): " + response.getContentAsString());
+ assertTrue(response.getContentAsString() != null
+ && response.getContentAsString().contains("microServiceDictionaryData"));
+ } catch (Exception e) {
+ fail("Exception: " + e);
+ }
+ logger.info("testRemoveMicroServiceModelsDictionary: exit");
+ }
+
+ @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");
+ }