summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/test
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-10-07 15:26:08 -0400
committerPamela Dragosh <pdragosh@research.att.com>2019-10-07 19:57:49 -0400
commitdbfa1570cd26d19b346287a6fb06f2d8a03f4a06 (patch)
tree93ead8432b6d509a3d16445d44c95631c4ef442a /POLICY-SDK-APP/src/test
parentb831c6a3df8e1dc9017ae5e8ad002dc3b1002aab (diff)
Use lombok for data objects
Removing lines to see if this will bump coverage. Some sonar for Junit tests and missing coverage. My next task will be to re-use some of this duplicate code for these object types and the controllers. Trailing spaces for patch #3. Issue-ID: POLICY-2133 Change-Id: Iaee123c6be4b63bd831172340709fe7597feaa78 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/test')
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java25
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyRolesControllerTest.java5
2 files changed, 27 insertions, 3 deletions
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
index 0d5a09754..372090fdf 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
@@ -22,6 +22,7 @@
package org.onap.policy.controller;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.UnsupportedEncodingException;
@@ -50,6 +51,11 @@ public class PDPControllerTest extends Mockito {
private Set<StdPDPGroup> groups;
private static List<Object> rolesdata;
+ /**
+ * Before.
+ *
+ * @throws Exception Exception
+ */
@Before
public void setUp() throws Exception {
logger.info("setUp: Entering");
@@ -79,9 +85,9 @@ public class PDPControllerTest extends Mockito {
}
@Test
- public void testPDPGroupData() {
- HttpServletRequest request = mock(HttpServletRequest.class);
- MockHttpServletResponse response = new MockHttpServletResponse();
+ public void testPdpGroupData() {
+ final HttpServletRequest request = mock(HttpServletRequest.class);
+ final MockHttpServletResponse response = new MockHttpServletResponse();
PolicyController controller = mock(PolicyController.class);
PDPController pdpController = new PDPController();
pdpController.setJunit(true);;
@@ -95,4 +101,17 @@ public class PDPControllerTest extends Mockito {
logger.error("Exception Occured" + e);
}
}
+
+ @Test
+ public void testPdpData() {
+ PdpData data = new PdpData();
+ data.setId("id");
+ assertEquals("id", data.getId());
+ data.setDescription("foo");
+ assertEquals("foo", data.getDescription());
+ data.setJmxPort(0);
+ assertEquals(0, data.getJmxPort());
+ data.setName("name");
+ assertEquals("name", data.getName());
+ }
}
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyRolesControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyRolesControllerTest.java
index 720f6ca76..e24525619 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyRolesControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyRolesControllerTest.java
@@ -51,6 +51,11 @@ public class PolicyRolesControllerTest {
private PolicyRolesController controller = null;
private static CommonClassDao commonClassDao;
+ /**
+ * Before.
+ *
+ * @throws Exception exception
+ */
@Before
public void setUp() throws Exception {
logger.info("setUp: Entering");