diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
index 244901a..e943883 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
@@ -22,23 +22,28 @@
 
 package org.onap.policy.admin;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
+import javax.json.JsonArray;
 import javax.servlet.ServletConfig;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
 import org.apache.commons.io.IOUtils;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mockito;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
 import org.onap.policy.common.logging.flexlogger.Logger;
@@ -55,8 +60,12 @@
 import org.onap.policy.rest.jpa.UserInfo;
 import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.util.SystemProperties;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
 import org.springframework.mock.web.MockHttpServletResponse;
 
+@RunWith(PowerMockRunner.class)
 public class PolicyManagerServletTest extends Mockito {
 
     private static Logger logger = FlexLogger.getLogger(PolicyManagerServletTest.class);
@@ -746,4 +755,63 @@
             }
         }
     }
+
+    @Test
+    public void testSetPolicyNames() {
+        JsonArray mockJsonArray = Mockito.mock(JsonArray.class);
+        PolicyManagerServlet.setPolicyNames(mockJsonArray);
+        assertEquals(mockJsonArray, PolicyManagerServlet.getPolicyNames());
+    }
+
+    @Test
+    public void testDoPostSetErrorException() throws IOException {
+        PolicyManagerServlet servlet = new PolicyManagerServlet();
+        HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);
+        HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+        doThrow(IOException.class).when(mockRequest).getReader();
+        doThrow(IOException.class).when(mockResponse).sendError(any(Integer.class), any(String.class));
+        servlet.doPost(mockRequest, mockResponse);
+        verify(mockRequest).getReader();
+    }
+
+    @Test
+    public void testDoPostException() throws IOException {
+        PolicyManagerServlet servlet = new PolicyManagerServlet();
+        HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);
+        HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+
+        doThrow(IOException.class).when(mockRequest).getReader();
+        doThrow(IOException.class).when(mockResponse).sendError(any(Integer.class), any(String.class));
+        doThrow(IOException.class).when(mockResponse).getWriter();
+
+        servlet.doPost(mockRequest, mockResponse);
+        verify(mockRequest).getReader();
+        verify(mockResponse).getWriter();
+    }
+
+    @Test
+    public void testDoPostSuccess() throws IOException {
+        PolicyManagerServlet servlet = new PolicyManagerServlet();
+        HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);
+        HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+        PrintWriter mockPrintWriter = Mockito.mock(PrintWriter.class);
+
+        doThrow(IOException.class).when(mockRequest).getReader();
+        when(mockResponse.getWriter()).thenReturn(mockPrintWriter);
+
+        servlet.doPost(null, mockResponse);
+        verify(mockResponse).getWriter();
+    }
+
+    @PrepareForTest(ServletFileUpload.class)
+    @Test
+    public void testDoPostUploadFileException() {
+        PolicyManagerServlet servlet = new PolicyManagerServlet();
+        HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);
+        HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+        PowerMockito.mockStatic(ServletFileUpload.class);
+        when(ServletFileUpload.isMultipartContent(mockRequest)).thenReturn(true);
+        servlet.doPost(mockRequest, mockResponse);
+        PowerMockito.verifyStatic(ServletFileUpload.class, Mockito.times(1));
+    }
 }
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
index bf4b676..55e4b5a 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
@@ -24,11 +24,15 @@
 
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
+import java.io.IOException;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -62,4 +66,14 @@
             fail();
         }
     }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testGetPolicyUserInfoException() throws IOException {
+        HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
+        when(mockResponse.getWriter()).thenThrow(IOException.class);
+        PolicyUserInfoController controller = new PolicyUserInfoController();
+        controller.getPolicyUserInfo(request, mockResponse);
+        verify(mockResponse, atLeast(1)).getWriter();
+    }
 }
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/model/PDPGroupContainerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/model/PDPGroupContainerTest.java
index f184bde..5204fc4 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/model/PDPGroupContainerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/model/PDPGroupContainerTest.java
@@ -21,8 +21,12 @@
 package org.onap.policy.model;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.when;
 
 import com.att.research.xacml.api.pap.PAPException;
 import java.awt.Checkbox;
@@ -106,7 +110,7 @@
     }
 
     @Test(expected = IndexOutOfBoundsException.class)
-    public void testGetIdByIndex() {
+    public void testGetIdByIndexException() {
         container.getIdByIndex(0);
     }
 
@@ -116,7 +120,7 @@
     }
 
     @Test(expected = IllegalArgumentException.class)
-    public void testGetItemIds() {
+    public void testGetItemIdsException() {
         container.getItemIds(0, 1);
     }
 
@@ -165,4 +169,96 @@
         doThrow(PAPException.class).when(engine).removePDP(pdp);
         container.removePDP(pdp, group);
     }
-}
\ No newline at end of file
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void testRemoveDefaultGroup() throws PAPException {
+        when(group.isDefaultGroup()).thenReturn(true);
+        container.removeGroup(group, newGroup);
+    }
+
+    @Test
+    public void testGetItemIds() {
+        assertNotNull(container.getItemIds(0, 0));
+    }
+
+    @Test
+    public void testContainsId() {
+        assertFalse(container.containsId(group));
+    }
+
+    @Test
+    public void testGroupMethods() {
+        container.groups.add(group);
+
+        Object retObj = container.getIdByIndex(0);
+        assertTrue(retObj instanceof OnapPDPGroup);
+        assertNotNull(retObj);
+
+        Object retFirstItemId = container.firstItemId();
+        assertTrue(retFirstItemId instanceof OnapPDPGroup);
+        assertNotNull(retFirstItemId);
+
+        Object retLastItemId = container.lastItemId();
+        assertTrue(retLastItemId instanceof OnapPDPGroup);
+        assertNotNull(retLastItemId);
+
+        assertTrue(container.isFirstId(group));
+
+        assertTrue(container.isLastId(group));
+    }
+
+    @Test
+    public void testNextItemId() {
+        OnapPDPGroup groupNotInList = Mockito.mock(OnapPDPGroup.class);
+        Object retObj = null;
+
+        container.groups.add(group);
+        container.groups.add(newGroup);
+
+        assertNull(container.nextItemId(groupNotInList));
+        assertNull(container.nextItemId(newGroup));
+
+        retObj = container.nextItemId(group);
+        assertNotNull(retObj);
+        assertTrue(retObj instanceof OnapPDPGroup);
+    }
+
+    @Test
+    public void testPrevItemId() {
+        OnapPDPGroup groupNotInList = Mockito.mock(OnapPDPGroup.class);
+        Object retObj = null;
+
+        container.groups.add(group);
+        container.groups.add(newGroup);
+
+        assertNull(container.prevItemId(groupNotInList));
+        assertNull(container.prevItemId(group));
+
+        retObj = container.prevItemId(newGroup);
+        assertNotNull(retObj);
+        assertTrue(retObj instanceof OnapPDPGroup);
+    }
+
+    @Test
+    public void testRemoveNullItem() {
+        OnapPDPGroup nullGroup = null;
+        assertFalse(container.removeItem(nullGroup));
+    }
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void testRemoveDefaultItem() {
+        when(group.getId()).thenReturn("Default");
+        container.removeItem(group);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testRemoveItem() throws PAPException {
+        assertTrue(container.removeItem(group));
+
+        PAPPolicyEngine mockPAPPolicyEngine = Mockito.mock(PAPPolicyEngine.class);
+        PDPGroupContainer groupContainer = new PDPGroupContainer(mockPAPPolicyEngine);
+        when(mockPAPPolicyEngine.getDefaultGroup()).thenThrow(PAPException.class);
+        assertFalse(groupContainer.removeItem(group));
+    }
+}
