summaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/test/java
diff options
context:
space:
mode:
authorTarun Tej Velaga <tt3868@att.com>2017-08-14 15:48:57 +0000
committerTarun Tej Velaga <tt3868@att.com>2017-08-14 19:25:48 +0000
commitc96dd91383b465c372f61664ebd584eeebe68f77 (patch)
tree58e10329a9e1bdbd1e7be19eddb8fe4b2eb5d80f /ONAP-PAP-REST/src/test/java
parentce1cf85647ab1ae3c292fd1b1286ea0dbb56223f (diff)
Fixes for eclipse warnings unused variables
Removed unused code in PAP REST caused eclipse warnings Issue-Id: POLICY-154 Change-Id: I376a2a96cb0fffd1dc89af6088362c60158e9256 Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/test/java')
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/DictionaryControllerTest.java22
-rw-r--r--ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java5
2 files changed, 3 insertions, 24 deletions
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..26509b1aa 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
@@ -21,7 +21,8 @@
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 +33,20 @@ 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.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.Attribute;
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 <code>DictionaryControllerTest</code> contains tests
* for the class {@link <code>DictionaryController</code>}*
@@ -68,18 +60,15 @@ 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");
commonClassDao = Mockito.mock(CommonClassDao.class);
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
-
- List<Object> microServiceModelsData = new ArrayList<Object>();
+
MicroServiceModels testData = new MicroServiceModels();
testData.setVersion("1707.4.1.2-Junit");
@@ -102,11 +91,6 @@ public class DictionaryControllerTest {
+ " \"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\"} }";
-
- configBodyString = "{\"service\":\"SniroPolicyEntityTest\",\"policyName\":\"someone\",\"description\":\"test\",\"templateVersion\":\"1607\",\"version\":\"HD\","
- + "\"priority\":\"2\",\"content\":{\"lastPolled\":\"1\",\"boolen-test\":\"true\",\"created\":\"test\",\"retiredDate\":\"test\",\"scope\":\"SNIRO_PLACEMENT_VDHV\","
- + "\"name\":\"test\",\"lastModified\":\"test\",\"state\":\"CREATED\",\"type\":\"CONFIG\",\"intent\":\"test\",\"target\":\"SNIRO\"}}";
-
request = mock(HttpServletRequest.class);
BufferedReader br = new BufferedReader(new StringReader(jsonString));
//--- mock the getReader() call
diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
index c66ace11e..e307820e5 100644
--- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
+++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/controller/MicroServiceDictionaryControllerTest.java
@@ -63,7 +63,6 @@ public class MicroServiceDictionaryControllerTest {
private static Logger logger = FlexLogger.getLogger(MicroServiceDictionaryControllerTest.class);
private static CommonClassDao commonClassDao;
private String jsonString = null;
- private String configBodyString = null;
private HttpServletRequest request = null;
private MicroServiceDictionaryController controller = null;
BufferedReader br = null;
@@ -106,10 +105,6 @@ public class MicroServiceDictionaryControllerTest {
+ " \"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\"} }";
-
- configBodyString = "{\"service\":\"SniroPolicyEntityTest\",\"policyName\":\"someone\",\"description\":\"test\",\"templateVersion\":\"1607\",\"version\":\"HD\","
- + "\"priority\":\"2\",\"content\":{\"lastPolled\":\"1\",\"boolen-test\":\"true\",\"created\":\"test\",\"retiredDate\":\"test\",\"scope\":\"SNIRO_PLACEMENT_VDHV\","
- + "\"name\":\"test\",\"lastModified\":\"test\",\"state\":\"CREATED\",\"type\":\"CONFIG\",\"intent\":\"test\",\"target\":\"SNIRO\"}}";
br = new BufferedReader(new StringReader(jsonString));
//--- mock the getReader() call