X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcontroller%2FDictionaryControllerTest.java;h=52b79b88fee7acc206470076c20040bcee842062;hp=708794d605fc6ce0f2ce79a817c197ceb45b1633;hb=1e61676b77dd09659027b8984f050df7e8538526;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
index 708794d60..52b79b88f 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-PAP-REST
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,10 +18,10 @@
* ============LICENSE_END=========================================================
*/
-
package org.onap.policy.pap.xacml.rest.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -32,29 +32,21 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-import javax.json.Json;
-import javax.json.JsonObject;
import javax.servlet.http.HttpServletRequest;
-import org.json.JSONObject;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
-import org.onap.policy.rest.adapter.PolicyRestAdapter;
+import org.onap.policy.pap.xacml.rest.util.DictionaryUtils;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.Attribute;
+import org.onap.policy.rest.jpa.Category;
import org.onap.policy.rest.jpa.MicroServiceModels;
import org.onap.policy.rest.jpa.PolicyEditorScopes;
import org.springframework.mock.web.MockHttpServletResponse;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.github.fge.jackson.JsonLoader;
-
/**
* The class DictionaryControllerTest
contains tests
* for the class {@link DictionaryController
}*
@@ -64,256 +56,216 @@ import com.github.fge.jackson.JsonLoader;
* tasks.
*/
public class DictionaryControllerTest {
-
- private static Logger logger = FlexLogger.getLogger(DictionaryControllerTest.class);
- private static CommonClassDao commonClassDao;
- private String jsonString = null;
- private String configBodyString = null;
- private HttpServletRequest request = null;
- private DictionaryController controller = null;
- private BufferedReader br = null;
-
- @Before
- public void setUp() throws Exception {
- logger.info("setUp: Entering");
+
+ private static Logger logger = FlexLogger.getLogger(DictionaryControllerTest.class);
+ private static CommonClassDao commonClassDao;
+ private String jsonString = null;
+ private HttpServletRequest request = null;
+ private DictionaryController controller = null;
+
+ @Before
+ public void setUp() throws Exception {
+ logger.info("setUp: Entering");
commonClassDao = Mockito.mock(CommonClassDao.class);
- HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
-
- List