aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/policy
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
committerOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
commit1cfb08779ea0e00be69e072a940b3063e049fe6b (patch)
tree6602a900387c8393ed0dcd81c0539381632903c6 /vid-app-common/src/test/java/org/onap/vid/policy
parent2f20b001b9243e0f8b44aecc768ec265fd538732 (diff)
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/policy')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java70
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java22
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java24
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java54
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java50
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java12
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java33
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java11
8 files changed, 276 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java
new file mode 100644
index 000000000..4e2676c6a
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyResponseWrapperTest.java
@@ -0,0 +1,70 @@
+package org.onap.vid.policy;
+
+import org.junit.Test;
+
+public class PolicyResponseWrapperTest {
+
+ private PolicyResponseWrapper createTestSubject() {
+ return new PolicyResponseWrapper();
+ }
+
+ @Test
+ public void testGetEntity() throws Exception {
+ PolicyResponseWrapper testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getEntity();
+ }
+
+ @Test
+ public void testGetStatus() throws Exception {
+ PolicyResponseWrapper testSubject;
+ int result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatus();
+ }
+
+ @Test
+ public void testSetStatus() throws Exception {
+ PolicyResponseWrapper testSubject;
+ int v = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatus(v);
+ }
+
+ @Test
+ public void testSetEntity() throws Exception {
+ PolicyResponseWrapper testSubject;
+ String v = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setEntity(v);
+ }
+
+ @Test
+ public void testToString() throws Exception {
+ PolicyResponseWrapper testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.toString();
+ }
+
+ @Test
+ public void testGetResponse() throws Exception {
+ PolicyResponseWrapper testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getResponse();
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java
new file mode 100644
index 000000000..b94d21b91
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestIntTest.java
@@ -0,0 +1,22 @@
+package org.onap.vid.policy;
+
+import org.junit.Test;
+import org.onap.vid.policy.rest.RequestDetails;
+
+public class PolicyRestIntTest {
+
+ private PolicyRestInt createTestSubject() {
+ return new PolicyRestInt();
+ }
+
+ @Test
+ public void testLogRequest() throws Exception {
+ PolicyRestInt testSubject;
+ RequestDetails r = null;
+
+ // test 1
+ testSubject = createTestSubject();
+ r = null;
+ testSubject.logRequest(r);
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java
new file mode 100644
index 000000000..04f6890e2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyRestInterfaceTest.java
@@ -0,0 +1,24 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.json.simple.JSONObject;
+import org.junit.Test;
+import org.onap.vid.policy.rest.RequestDetails;
+
+public class PolicyRestInterfaceTest {
+
+ private PolicyRestInterface createTestSubject() {
+ return new PolicyRestInterface();
+ }
+
+
+ @Test
+ public void testLogRequest() throws Exception {
+ PolicyRestInterface testSubject;
+ RequestDetails r = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.logRequest(r);
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java
new file mode 100644
index 000000000..566d17c11
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/PolicyUtilTest.java
@@ -0,0 +1,54 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.glassfish.jersey.client.ClientResponse;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class PolicyUtilTest {
+
+ private PolicyUtil createTestSubject() {
+ return new PolicyUtil();
+ }
+
+ @Test
+ public void testWrapResponse() throws Exception {
+ String body = "";
+ int statusCode = 0;
+ PolicyResponseWrapper result;
+
+ // default test
+ result = PolicyUtil.wrapResponse(body, statusCode);
+ }
+
+
+ @Test
+ public void testWrapResponse_2() throws Exception {
+ RestObject<String> rs = null;
+ PolicyResponseWrapper result;
+
+ // test 1
+ rs = null;
+ result = PolicyUtil.wrapResponse(rs);
+ Assert.assertNotNull(result);
+ }
+
+ @Test
+ public void testConvertPojoToString() throws Exception {
+ T t = null;
+ String result;
+
+ // test 1
+ t = null;
+ result = PolicyUtil.convertPojoToString(t);
+ Assert.assertEquals("", result);
+ }
+
+ @Test
+ public void testMain() throws Exception {
+ String[] args = new String[] { "" };
+
+ // default test
+ PolicyUtil.main(args);
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java
new file mode 100644
index 000000000..7665d99a2
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/RestObjectTest.java
@@ -0,0 +1,50 @@
+package org.onap.vid.policy;
+
+import org.apache.poi.hssf.record.formula.functions.T;
+import org.junit.Test;
+
+public class RestObjectTest {
+
+ private RestObject createTestSubject() {
+ return new RestObject();
+ }
+
+ @Test
+ public void testSet() throws Exception {
+ RestObject testSubject;
+ T t = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.set(t);
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ RestObject testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.get();
+ }
+
+ @Test
+ public void testSetStatusCode() throws Exception {
+ RestObject testSubject;
+ int v = 0;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatusCode(v);
+ }
+
+ @Test
+ public void testGetStatusCode() throws Exception {
+ RestObject testSubject;
+ int result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatusCode();
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java
new file mode 100644
index 000000000..6d2a790be
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/TestSuite.java
@@ -0,0 +1,12 @@
+package org.onap.vid.policy;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RestObjectTest.class, PolicyResponseWrapperTest.class, PolicyRestIntTest.class, PolicyUtilTest.class,
+ PolicyRestInterfaceTest.class, org.onap.vid.policy.rest.TestSuite.class })
+public class TestSuite { // nothing
+}
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java b/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java
new file mode 100644
index 000000000..3c17a66a0
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/rest/RequestDetailsTest.java
@@ -0,0 +1,33 @@
+package org.onap.vid.policy.rest;
+
+import org.junit.Test;
+
+
+public class RequestDetailsTest {
+
+ private RequestDetails createTestSubject() {
+ return new RequestDetails();
+ }
+
+
+ @Test
+ public void testGetPolicyName() throws Exception {
+ RequestDetails testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getPolicyName();
+ }
+
+
+ @Test
+ public void testSetPolicyName() throws Exception {
+ RequestDetails testSubject;
+ String policyName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setPolicyName(policyName);
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java b/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java
new file mode 100644
index 000000000..0a8dfff91
--- /dev/null
+++ b/vid-app-common/src/test/java/org/onap/vid/policy/rest/TestSuite.java
@@ -0,0 +1,11 @@
+package org.onap.vid.policy.rest;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses(
+
+{ RequestDetailsTest.class })
+public class TestSuite { // nothing
+}