summaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/test/java/org
diff options
context:
space:
mode:
authorTarun Tej Velaga <tt3868@att.com>2017-07-24 17:13:43 +0000
committerTarun Tej Velaga <tt3868@att.com>2017-07-25 14:23:59 +0000
commite92ff832cf993db876f22b2d27562fedf59f5043 (patch)
tree47429eeaaf4241905d7ea1f71dbdb5c2d0504618 /ECOMP-PAP-REST/src/test/java/org
parent570290dc6ba8198e653022c2f6f8e5d01cfa8d1b (diff)
[Policy-52, Policy-92, Policy-93] Policy Enhancements and bugfixes
Change-Id: I5675cf4527e17963b3142cf7184c0df31a766197 Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
Diffstat (limited to 'ECOMP-PAP-REST/src/test/java/org')
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java2
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java13
-rw-r--r--ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java23
3 files changed, 29 insertions, 9 deletions
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
index 3e1ef0469..2fef9a7cb 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/ia/DbAuditCompareEntriesTest.java
@@ -447,4 +447,4 @@ public class DbAuditCompareEntriesTest {
assertEquals(1, result.size());
logger.info("testResourceRegistrationEntity: Exit");
}
-}
+} \ No newline at end of file
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
index fa2899a79..82427e8cb 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/DictionaryControllerTest.java
@@ -25,24 +25,36 @@ import static org.junit.Assert.*;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+
import java.io.BufferedReader;
import java.io.StringReader;
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.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
+import org.openecomp.policy.rest.adapter.PolicyRestAdapter;
import org.openecomp.policy.rest.dao.CommonClassDao;
import org.openecomp.policy.rest.jpa.Attribute;
import org.openecomp.policy.rest.jpa.MicroServiceModels;
import org.openecomp.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 <code>DictionaryControllerTest</code> contains tests
* for the class {@link <code>DictionaryController</code>}*
@@ -51,7 +63,6 @@ import org.springframework.mock.web.MockHttpServletResponse;
* where they have write privileges and can execute time-sensitive
* tasks.
*/
-
public class DictionaryControllerTest {
private static Logger logger = FlexLogger.getLogger(DictionaryControllerTest.class);
diff --git a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
index 87b5e3dbb..c1f2973d3 100644
--- a/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
+++ b/ECOMP-PAP-REST/src/test/java/org/openecomp/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
@@ -21,12 +21,24 @@
package org.openecomp.policy.pap.xacml.rest.controller;
+import static org.junit.Assert.assertEquals;
+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;
+
import java.io.BufferedReader;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
+
import javax.servlet.http.HttpServletRequest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
import org.mockito.Mockito;
import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
import org.openecomp.policy.common.logging.flexlogger.Logger;
@@ -35,12 +47,7 @@ import org.openecomp.policy.rest.jpa.DCAEuuid;
import org.openecomp.policy.rest.jpa.MicroServiceLocation;
import org.openecomp.policy.rest.jpa.MicroServiceModels;
import org.openecomp.policy.rest.jpa.UserInfo;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
import org.springframework.mock.web.MockHttpServletResponse;
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
/**
* The class <code>MicroServiceDictionaryControllerTest</code> contains tests
@@ -50,6 +57,7 @@ import static org.mockito.Mockito.*;
* where they have write privileges and can execute time-sensitive
* tasks.
*/
+
public class MicroServiceDictionaryControllerTest {
private static Logger logger = FlexLogger.getLogger(MicroServiceDictionaryControllerTest.class);
@@ -84,8 +92,9 @@ public class MicroServiceDictionaryControllerTest {
doNothing().when(commonClassDao).delete(microServiceModels);
-
- controller = new MicroServiceDictionaryController(commonClassDao);
+ MicroServiceDictionaryController.setCommonClassDao(commonClassDao);
+
+ controller = new MicroServiceDictionaryController();
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);