diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java
index 0337161..f10abdd 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java
@@ -49,6 +49,7 @@
 import org.onap.policy.pap.main.comm.msgdata.RequestListener;
 import org.onap.policy.pap.main.comm.msgdata.StateChangeReq;
 import org.onap.policy.pap.main.comm.msgdata.UpdateReq;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
 import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams;
 import org.onap.policy.pap.main.parameters.PdpParameters;
 import org.onap.policy.pap.main.parameters.PdpStateChangeParameters;
@@ -70,6 +71,7 @@
     protected static final int RETRIES = 1;
 
     protected Publisher<PdpMessage> publisher;
+    protected PolicyNotifier notifier;
     protected RequestIdDispatcher<PdpStatus> dispatcher;
     protected Object lock;
     protected TimerManager timers;
@@ -90,6 +92,7 @@
     @SuppressWarnings("unchecked")
     public void setUp() throws Exception {
         publisher = mock(Publisher.class);
+        notifier = mock(PolicyNotifier.class);
         dispatcher = mock(RequestIdDispatcher.class);
         lock = new Object();
         timers = mock(TimerManager.class);
@@ -121,12 +124,12 @@
         when(updateParams.getMaxRetryCount()).thenReturn(RETRIES);
         when(pdpParams.getUpdateParameters()).thenReturn(updateParams);
 
-        reqParams = new RequestParams().setMaxRetryCount(RETRIES).setModifyLock(lock).setPublisher(publisher)
+        reqParams = new RequestParams().setMaxRetryCount(RETRIES).setModifyLock(lock).setPdpPublisher(publisher)
                         .setResponseDispatcher(dispatcher).setTimers(timers);
 
-        mapParams = new PdpModifyRequestMapParams().setModifyLock(lock).setPublisher(publisher)
-                        .setResponseDispatcher(dispatcher).setDaoFactory(daoFactory).setUpdateTimers(timers)
-                        .setStateChangeTimers(timers).setParams(pdpParams);
+        mapParams = new PdpModifyRequestMapParams().setModifyLock(lock).setPdpPublisher(publisher)
+                        .setPolicyNotifier(notifier).setResponseDispatcher(dispatcher).setDaoFactory(daoFactory)
+                        .setUpdateTimers(timers).setStateChangeTimers(timers).setParams(pdpParams);
     }
 
     /**
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java
index 92f5c5f..d0bc200 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpModifyRequestMapTest.java
@@ -305,6 +305,9 @@
         // should have stopped publishing
         verify(requests).stopPublishing();
 
+        // should have generated a notification
+        verify(notifier).removePdp(PDP1);
+
         // should have published a new update
         PdpMessage msg2 = getSingletons(3).get(1).getMessage();
         assertNotNull(msg2);
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java
index 1bf7322..ccb13fe 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpRequestsTest.java
@@ -50,7 +50,7 @@
         update = makeUpdateReq(PDP1, MY_GROUP, MY_SUBGROUP);
         change = makeStateChangeReq(PDP1, MY_STATE);
 
-        data = new PdpRequests(PDP1);
+        data = new PdpRequests(PDP1, notifier);
     }
 
     @Test
@@ -62,6 +62,7 @@
     public void testAddSingleton() {
         data.addSingleton(update);
 
+        verify(update).setNotifier(notifier);
         verify(update).startPublishing(any());
     }
 
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java
index 3d90fcb..e47f879 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/RequestImplTest.java
@@ -383,7 +383,7 @@
 
     @Test
     public void testResetRetryCount_testBumpRetryCount() {
-        req = new MyRequest(new RequestParams().setMaxRetryCount(2).setModifyLock(lock).setPublisher(publisher)
+        req = new MyRequest(new RequestParams().setMaxRetryCount(2).setModifyLock(lock).setPdpPublisher(publisher)
                         .setResponseDispatcher(dispatcher).setTimers(timers), MY_REQ_NAME, msg);
         req.setListener(listener);
 
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
index a798770..80ed0fb 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/msgdata/UpdateReqTest.java
@@ -25,9 +25,13 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Set;
 import java.util.stream.Collectors;
 import org.junit.Before;
 import org.junit.Test;
@@ -45,6 +49,7 @@
 
     /**
      * Sets up.
+     *
      * @throws Exception if an error occurs
      */
     @Before
@@ -62,6 +67,7 @@
                         update.getPolicies().stream().map(ToscaPolicy::getIdentifier).collect(Collectors.toList()));
 
         data = new UpdateReq(reqParams, MY_REQ_NAME, update);
+        data.setNotifier(notifier);
     }
 
     @Test
@@ -73,6 +79,7 @@
     @Test
     public void testCheckResponse() {
         assertNull(data.checkResponse(response));
+        verifyResponse();
 
         // both policy lists null
         update.setPolicies(null);
@@ -85,6 +92,7 @@
         response.setName(null);
 
         assertEquals("null PDP name", data.checkResponse(response));
+        verifyNoResponse();
     }
 
     @Test
@@ -92,6 +100,7 @@
         update.setName(null);
 
         assertEquals(null, data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -99,6 +108,7 @@
         response.setPdpGroup(DIFFERENT);
 
         assertEquals("group does not match", data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -106,6 +116,7 @@
         response.setPdpSubgroup(DIFFERENT);
 
         assertEquals("subgroup does not match", data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -116,6 +127,7 @@
         response.setPolicies(policies.stream().map(ToscaPolicy::getIdentifier).collect(Collectors.toList()));
 
         assertEquals("policies do not match", data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -123,6 +135,7 @@
         update.setPolicies(null);
 
         assertEquals("policies do not match", data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -130,6 +143,7 @@
         response.setPolicies(null);
 
         assertEquals("policies do not match", data.checkResponse(response));
+        verifyResponse();
     }
 
     @Test
@@ -222,6 +236,16 @@
         assertTrue(data.getPriority() > new StateChangeReq(reqParams, MY_REQ_NAME, new PdpStateChange()).getPriority());
     }
 
+    @SuppressWarnings("unchecked")
+    private void verifyResponse() {
+        verify(notifier).processResponse(any(), any(Set.class));
+    }
+
+    @SuppressWarnings("unchecked")
+    private void verifyNoResponse() {
+        verify(notifier, never()).processResponse(any(), any(Set.class));
+    }
+
     /**
      * Makes an update message.
      *
diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
index b9dde72..629cf24 100644
--- a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
+++ b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
@@ -27,18 +27,23 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher;
+import org.onap.policy.models.pdp.concepts.PdpMessage;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
+import org.onap.policy.pap.main.PolicyModelsProviderFactoryWrapper;
 import org.onap.policy.pap.main.comm.Publisher;
 import org.onap.policy.pap.main.comm.TimerManager;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
 
 public class TestPdpModifyRequestMapParams {
     private PdpModifyRequestMapParams params;
-    private Publisher pub;
+    private Publisher<PdpMessage> pub;
     private RequestIdDispatcher<PdpStatus> disp;
     private Object lock;
     private PdpParameters pdpParams;
     private TimerManager updTimers;
     private TimerManager stateTimers;
+    private PolicyModelsProviderFactoryWrapper dao;
+    private PolicyNotifier notifier;
 
     /**
      * Sets up the objects and creates an empty {@link #params}.
@@ -52,19 +57,24 @@
         pdpParams = mock(PdpParameters.class);
         updTimers = mock(TimerManager.class);
         stateTimers = mock(TimerManager.class);
+        dao = mock(PolicyModelsProviderFactoryWrapper.class);
+        notifier = mock(PolicyNotifier.class);
 
-        params = new PdpModifyRequestMapParams().setModifyLock(lock).setPublisher(pub).setResponseDispatcher(disp)
-                        .setParams(pdpParams).setStateChangeTimers(stateTimers).setUpdateTimers(updTimers);
+        params = new PdpModifyRequestMapParams().setModifyLock(lock).setPdpPublisher(pub).setResponseDispatcher(disp)
+                        .setParams(pdpParams).setStateChangeTimers(stateTimers).setUpdateTimers(updTimers)
+                        .setDaoFactory(dao).setPolicyNotifier(notifier);
     }
 
     @Test
     public void testGettersSetters() {
-        assertSame(pub, params.getPublisher());
+        assertSame(pub, params.getPdpPublisher());
         assertSame(disp, params.getResponseDispatcher());
         assertSame(lock, params.getModifyLock());
         assertSame(pdpParams, params.getParams());
         assertSame(updTimers, params.getUpdateTimers());
         assertSame(stateTimers, params.getStateChangeTimers());
+        assertSame(dao, params.getDaoFactory());
+        assertSame(notifier, params.getPolicyNotifier());
     }
 
     @Test
@@ -75,7 +85,7 @@
 
     @Test
     public void testValidate_MissingPublisher() {
-        assertThatIllegalArgumentException().isThrownBy(() -> params.setPublisher(null).validate())
+        assertThatIllegalArgumentException().isThrownBy(() -> params.setPdpPublisher(null).validate())
                         .withMessageContaining("publisher");
     }
 
@@ -108,4 +118,16 @@
         assertThatIllegalArgumentException().isThrownBy(() -> params.setUpdateTimers(null).validate())
                         .withMessageContaining("update");
     }
+
+    @Test
+    public void testValidate_MissingDaoFactory() {
+        assertThatIllegalArgumentException().isThrownBy(() -> params.setDaoFactory(null).validate())
+                        .withMessageContaining("DAO");
+    }
+
+    @Test
+    public void testValidate_MissingNotifier() {
+        assertThatIllegalArgumentException().isThrownBy(() -> params.setPolicyNotifier(null).validate())
+                        .withMessageContaining("notifier");
+    }
 }
diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/TestRequestParams.java b/main/src/test/java/org/onap/policy/pap/main/parameters/TestRequestParams.java
index b4855e7..7c5a395 100644
--- a/main/src/test/java/org/onap/policy/pap/main/parameters/TestRequestParams.java
+++ b/main/src/test/java/org/onap/policy/pap/main/parameters/TestRequestParams.java
@@ -28,6 +28,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher;
+import org.onap.policy.models.pdp.concepts.PdpMessage;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 import org.onap.policy.pap.main.comm.Publisher;
 import org.onap.policy.pap.main.comm.TimerManager;
@@ -36,7 +37,7 @@
     private static final int RETRIES = 1;
 
     private RequestParams params;
-    private Publisher pub;
+    private Publisher<PdpMessage> pub;
     private RequestIdDispatcher<PdpStatus> disp;
     private Object lock;
     private TimerManager timers;
@@ -52,15 +53,15 @@
         lock = new Object();
         timers = mock(TimerManager.class);
 
-        params = new RequestParams().setModifyLock(lock).setPublisher(pub).setResponseDispatcher(disp).setTimers(timers)
-                        .setMaxRetryCount(RETRIES);
+        params = new RequestParams().setModifyLock(lock).setPdpPublisher(pub).setResponseDispatcher(disp)
+                        .setTimers(timers).setMaxRetryCount(RETRIES);
     }
 
     @Test
     public void testGettersSetters() {
-        assertSame(params, params.setModifyLock(lock).setPublisher(pub).setResponseDispatcher(disp));
+        assertSame(params, params.setModifyLock(lock).setPdpPublisher(pub).setResponseDispatcher(disp));
 
-        assertSame(pub, params.getPublisher());
+        assertSame(pub, params.getPdpPublisher());
         assertSame(disp, params.getResponseDispatcher());
         assertSame(lock, params.getModifyLock());
         assertSame(timers, params.getTimers());
@@ -87,7 +88,7 @@
 
     @Test
     public void testValidate_MissingPublisher() {
-        assertThatIllegalArgumentException().isThrownBy(() -> params.setPublisher(null).validate())
+        assertThatIllegalArgumentException().isThrownBy(() -> params.setPdpPublisher(null).validate())
                         .withMessageContaining("publisher");
     }
 
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/ProviderSuper.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/ProviderSuper.java
index 2fca684..3f29fb5 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/ProviderSuper.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/ProviderSuper.java
@@ -52,6 +52,7 @@
 import org.onap.policy.pap.main.PapConstants;
 import org.onap.policy.pap.main.PolicyModelsProviderFactoryWrapper;
 import org.onap.policy.pap.main.comm.PdpModifyRequestMap;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
 
 /**
  * Super class for TestPdpGroupDeployProviderXxx classes.
@@ -62,6 +63,9 @@
     @Mock
     protected PolicyModelsProvider dao;
 
+    @Mock
+    protected PolicyNotifier notifier;
+
 
     /**
      * Used to capture input to dao.updatePdpGroups() and dao.createPdpGroups().
@@ -103,6 +107,7 @@
         Registry.register(PapConstants.REG_PDP_MODIFY_LOCK, lockit);
         Registry.register(PapConstants.REG_PDP_MODIFY_MAP, reqmap);
         Registry.register(PapConstants.REG_PAP_DAO_FACTORY, daofact);
+        Registry.register(PapConstants.REG_POLICY_NOTIFIER, notifier);
     }
 
     protected void assertGroup(List<PdpGroup> groups, String name) {
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteProvider.java
index a577e07..cac1680 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteProvider.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteProvider.java
@@ -26,8 +26,8 @@
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
@@ -35,11 +35,14 @@
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.function.BiFunction;
+import java.util.Set;
 import javax.ws.rs.core.Response.Status;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
@@ -48,17 +51,23 @@
 import org.onap.policy.models.pdp.enums.PdpState;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifierOptVersion;
+import org.onap.policy.pap.main.rest.depundep.ProviderBase.Updater;
 
 public class TestPdpGroupDeleteProvider extends ProviderSuper {
     private static final String EXPECTED_EXCEPTION = "expected exception";
     private static final String GROUP1_NAME = "groupA";
 
-    private MyProvider prov;
+    @Mock
     private SessionData session;
+
+    @Captor
+    private ArgumentCaptor<Set<String>> pdpCaptor;
+
+    private MyProvider prov;
     private ToscaPolicyIdentifierOptVersion optIdent;
     private ToscaPolicyIdentifierOptVersion fullIdent;
     private ToscaPolicyIdentifier ident;
-    private BiFunction<PdpGroup, PdpSubGroup, Boolean> updater;
+    private Updater updater;
 
 
     @AfterClass
@@ -76,14 +85,13 @@
 
         super.setUp();
 
-        session = mock(SessionData.class);
         ident = policy1.getIdentifier();
         optIdent = new ToscaPolicyIdentifierOptVersion(ident.getName(), null);
         fullIdent = new ToscaPolicyIdentifierOptVersion(ident.getName(), ident.getVersion());
 
         prov = new MyProvider();
 
-        updater = prov.makeUpdater(policy1, fullIdent);
+        updater = prov.makeUpdater(session, policy1, fullIdent);
     }
 
     @Test
@@ -215,7 +223,7 @@
     }
 
     @Test
-    public void testMakeUpdater_WithVersion() {
+    public void testMakeUpdater_WithVersion() throws PfModelException {
         /*
          * this group has two matching policies and one policy with a different name.
          */
@@ -230,10 +238,13 @@
         // identified policy should have been removed
         assertEquals(origSize - 1, subgroup.getPolicies().size());
         assertFalse(subgroup.getPolicies().contains(ident));
+
+        verify(session).trackUndeploy(eq(ident), pdpCaptor.capture());
+        assertEquals("[pdpA]", pdpCaptor.getValue().toString());
     }
 
     @Test
-    public void testMakeUpdater_NullVersion() {
+    public void testMakeUpdater_NullVersion() throws PfModelException {
         /*
          * this group has two matching policies and one policy with a different name.
          */
@@ -243,7 +254,7 @@
         int origSize = subgroup.getPolicies().size();
 
         // invoke updater - matching the name, but with a null (i.e., wild-card) version
-        updater = prov.makeUpdater(policy1, optIdent);
+        updater = prov.makeUpdater(session, policy1, optIdent);
         assertTrue(updater.apply(group, subgroup));
 
         // identified policy should have been removed
@@ -252,7 +263,7 @@
     }
 
     @Test
-    public void testMakeUpdater_NotFound() {
+    public void testMakeUpdater_NotFound() throws PfModelException {
         /*
          * this group has one policy with a different name and one with a different
          * version, but not the policy of interest.
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java
index 90ea165..c2d368a 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeployProvider.java
@@ -35,11 +35,13 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.TreeMap;
+import java.util.TreeSet;
 import java.util.stream.Collectors;
 import javax.ws.rs.core.Response.Status;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.ArgumentCaptor;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
@@ -53,6 +55,7 @@
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
+import org.onap.policy.pap.main.notification.PolicyPdpNotificationData;
 
 public class TestPdpGroupDeployProvider extends ProviderSuper {
     private static final String EXPECTED_EXCEPTION = "expected exception";
@@ -279,6 +282,14 @@
 
         assertEquals(newgrp.toString(), dbgroup.toString());
 
+        // no deployment notifications
+        verify(notifier, never()).addDeploymentData(any());
+
+        // should have notified of deleted subgroup's policies/PDPs
+        ArgumentCaptor<PolicyPdpNotificationData> captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier).addUndeploymentData(captor.capture());
+        assertDeploymentData(captor, policy1.getIdentifier(), "[pdpB, pdpD]");
+
         // this requires a PDP UPDATE message
         List<PdpUpdate> pdpUpdates = getUpdateRequests(2);
         assertEquals(2, pdpUpdates.size());
@@ -540,16 +551,23 @@
 
     @Test
     public void testUpdateSubGroup_Policies() throws Exception {
-        PdpGroups groups = loadPdpGroups("createGroups.json");
+        PdpGroups groups = loadPdpGroups("createGroupsDelPolicy.json");
         PdpGroup newgrp = groups.getGroups().get(0);
         PdpGroup group = new PdpGroup(newgrp);
         when(dao.getPdpGroups(group.getName())).thenReturn(Arrays.asList(group));
 
         PdpSubGroup subgrp = newgrp.getPdpSubgroups().get(0);
-        subgrp.getPolicies().add(new ToscaPolicyIdentifier(POLICY2_NAME, POLICY1_VERSION));
+
+        // delete second policy
+        subgrp.setPolicies(subgrp.getPolicies().subList(0, 1));
+
+        // add new policy
+        ToscaPolicyIdentifier policyId2 = new ToscaPolicyIdentifier(POLICY2_NAME, POLICY1_VERSION);
+        subgrp.getPolicies().add(policyId2);
 
         when(dao.getFilteredPolicyList(any())).thenReturn(loadPolicies("createGroupNewPolicy.json"))
                         .thenReturn(loadPolicies("daoPolicyList.json"))
+                        .thenReturn(loadPolicies("daoPolicyListDelPolicy.json"))
                         .thenReturn(loadPolicies("createGroupNewPolicy.json"));
 
         prov.createOrUpdateGroups(groups);
@@ -559,11 +577,43 @@
 
         assertEquals(newgrp.toString(), group.toString());
 
+        // should have notified of added policy/PDPs
+        ArgumentCaptor<PolicyPdpNotificationData> captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier).addDeploymentData(captor.capture());
+        assertDeploymentData(captor, policyId2, "[pdpA]");
+
+        // should have notified of deleted policy/PDPs
+        captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier).addUndeploymentData(captor.capture());
+        assertDeploymentData(captor, new ToscaPolicyIdentifier("ToBeDeleted", POLICY1_VERSION), "[pdpA]");
+
         // this requires a PDP UPDATE message
         assertGroupUpdate(group, subgrp);
     }
 
     @Test
+    public void testUpdateSubGroup_Unchanged() throws Exception {
+        PdpGroups groups = loadPdpGroups("createGroups.json");
+        PdpGroup newgrp = groups.getGroups().get(0);
+        PdpGroup group = new PdpGroup(newgrp);
+        when(dao.getPdpGroups(group.getName())).thenReturn(Arrays.asList(group));
+
+        prov.createOrUpdateGroups(groups);
+
+        Collections.sort(newgrp.getPdpSubgroups().get(0).getPolicies());
+        Collections.sort(group.getPdpSubgroups().get(0).getPolicies());
+
+        assertEquals(newgrp.toString(), group.toString());
+
+        // no notifications
+        verify(notifier, never()).addDeploymentData(any());
+        verify(notifier, never()).addUndeploymentData(any());
+
+        // no group updates
+        assertNoGroupAction();
+    }
+
+    @Test
     public void testUpdateSubGroup_PolicyVersionMismatch() throws Exception {
         PdpGroups groups = loadPdpGroups("createGroups.json");
         PdpGroup newgrp = groups.getGroups().get(0);
@@ -662,6 +712,14 @@
         List<PdpUpdate> requests = getUpdateRequests(2);
         assertUpdate(requests, GROUP1_NAME, PDP2_TYPE, PDP2);
         assertUpdate(requests, GROUP1_NAME, PDP4_TYPE, PDP4);
+
+        // should have notified of added policy/PDPs
+        ArgumentCaptor<PolicyPdpNotificationData> captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier).addDeploymentData(captor.capture());
+        assertDeploymentData(captor, policy1.getIdentifier(), "[pdpB, pdpD]");
+
+        // no undeployment notifications
+        verify(notifier, never()).addUndeploymentData(any());
     }
 
     @Test
@@ -741,6 +799,14 @@
         assertEquals(Arrays.asList(group), updates);
     }
 
+    private void assertDeploymentData(ArgumentCaptor<PolicyPdpNotificationData> captor, ToscaPolicyIdentifier policyId,
+                    String expectedPdps) {
+        PolicyPdpNotificationData data = captor.getValue();
+        assertEquals(policyId, data.getPolicyId());
+        assertEquals(policy1.getTypeIdentifier(), data.getPolicyType());
+        assertEquals(expectedPdps, new TreeSet<>(data.getPdps()).toString());
+    }
+
     /**
      * Loads a standard request.
      *
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestProviderBase.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestProviderBase.java
index 3a91363..9370a7b 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestProviderBase.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestProviderBase.java
@@ -26,6 +26,7 @@
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -34,20 +35,22 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
-import java.util.function.BiFunction;
+import java.util.TreeSet;
 import javax.ws.rs.core.Response.Status;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.ArgumentCaptor;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
 import org.onap.policy.models.pap.concepts.PdpDeployPolicies;
 import org.onap.policy.models.pdp.concepts.PdpGroup;
-import org.onap.policy.models.pdp.concepts.PdpSubGroup;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifierOptVersion;
+import org.onap.policy.pap.main.notification.PolicyPdpNotificationData;
 import org.powermock.reflect.Whitebox;
 
 public class TestProviderBase extends ProviderSuper {
@@ -103,6 +106,24 @@
         assertGroup(getGroupUpdates(), GROUP1_NAME);
 
         assertUpdate(getUpdateRequests(1), GROUP1_NAME, PDP1_TYPE, PDP1);
+
+        ArgumentCaptor<PolicyPdpNotificationData> captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier, times(2)).addDeploymentData(captor.capture());
+        assertNotifier(captor, PDP1, PDP3);
+
+        captor = ArgumentCaptor.forClass(PolicyPdpNotificationData.class);
+        verify(notifier, times(2)).addUndeploymentData(captor.capture());
+        assertNotifier(captor, PDP2, PDP4);
+    }
+
+    private void assertNotifier(ArgumentCaptor<PolicyPdpNotificationData> captor, String firstPdp, String secondPdp) {
+        assertEquals(1, captor.getAllValues().get(0).getPdps().size());
+        assertEquals(1, captor.getAllValues().get(1).getPdps().size());
+
+        // ensure the order by using a TreeSet
+        TreeSet<String> pdps = new TreeSet<>(captor.getAllValues().get(0).getPdps());
+        pdps.addAll(captor.getAllValues().get(1).getPdps());
+        assertEquals("[" + firstPdp + ", " + secondPdp + "]", pdps.toString());
     }
 
     @Test
@@ -345,13 +366,20 @@
         }
 
         @Override
-        protected BiFunction<PdpGroup, PdpSubGroup, Boolean> makeUpdater(ToscaPolicy policy,
+        protected Updater makeUpdater(SessionData data, ToscaPolicy policy,
                         ToscaPolicyIdentifierOptVersion desiredPolicy) {
 
             return (group, subgroup) -> {
                 if (shouldUpdate.remove()) {
                     // queue indicated that the update should succeed
                     subgroup.getPolicies().add(policy.getIdentifier());
+
+                    data.trackDeploy(policy.getIdentifier(), Collections.singleton(PDP1));
+                    data.trackUndeploy(policy.getIdentifier(), Collections.singleton(PDP2));
+
+                    ToscaPolicyIdentifier ident2 = new ToscaPolicyIdentifier(POLICY1_NAME, "9.9.9");
+                    data.trackDeploy(ident2, Collections.singleton(PDP3));
+                    data.trackUndeploy(ident2, Collections.singleton(PDP4));
                     return true;
 
                 } else {
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java
index d7d9b67..4d353a6 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestSessionData.java
@@ -41,6 +41,8 @@
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
+import java.util.TreeSet;
+import java.util.function.Supplier;
 import javax.ws.rs.core.Response.Status;
 import org.apache.commons.lang3.tuple.Pair;
 import org.junit.Before;
@@ -52,9 +54,11 @@
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifier;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyIdentifierOptVersion;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
+import org.onap.policy.pap.main.notification.PolicyPdpNotificationData;
 
 public class TestSessionData extends ProviderSuper {
     private static final String GROUP_NAME = "groupA";
@@ -533,6 +537,70 @@
         verify(dao).deletePdpGroup(group1.getName());
     }
 
+    @Test
+    public void testTrackDeploy() throws PfModelException {
+        testTrack(session::getDeployData, session::getUndeployData, session::trackDeploy);
+    }
+
+    /**
+     * Tests trackDeploy() when there is something in the undeployed list.
+     *
+     * @throws PfModelException if an error occurs
+     */
+    @Test
+    public void testTrackDeployRemoveUndeploy() throws PfModelException {
+        testTrack(session::getDeployData, session::getUndeployData, session::trackUndeploy, session::trackDeploy);
+    }
+
+    @Test
+    public void testTrackUndeploy() throws PfModelException {
+        testTrack(session::getUndeployData, session::getDeployData, session::trackUndeploy);
+    }
+
+    /**
+     * Tests trackUndeploy() when there is something in the deployed list.
+     *
+     * @throws PfModelException if an error occurs
+     */
+    @Test
+    public void testTrackUndeployRemoveUndeploy() throws PfModelException {
+        testTrack(session::getUndeployData, session::getDeployData, session::trackDeploy, session::trackUndeploy);
+    }
+
+    protected void testTrack(Supplier<Collection<PolicyPdpNotificationData>> expected,
+                    Supplier<Collection<PolicyPdpNotificationData>> unexpected, TrackEx... trackFuncs)
+                    throws PfModelException {
+
+        ToscaPolicy policy = makePolicy(POLICY_NAME, POLICY_VERSION);
+        policy.setType(POLICY_TYPE);
+        policy.setTypeVersion(POLICY_TYPE_VERSION);
+
+        when(dao.getFilteredPolicyList(any())).thenReturn(Arrays.asList(policy));
+
+        ToscaPolicyIdentifier policyId = new ToscaPolicyIdentifier(POLICY_NAME, POLICY_VERSION);
+        List<String> pdps = Arrays.asList(PDP1, PDP2);
+
+        for (TrackEx trackFunc : trackFuncs) {
+            trackFunc.accept(policyId, pdps);
+        }
+
+        // "unexpected" list should be empty of any PDPs
+        Collection<PolicyPdpNotificationData> dataList = unexpected.get();
+        assertTrue(dataList.size() <= 1);
+        if (!dataList.isEmpty()) {
+            PolicyPdpNotificationData data = dataList.iterator().next();
+            assertTrue(data.getPdps().isEmpty());
+        }
+
+        dataList = expected.get();
+        assertEquals(1, dataList.size());
+
+        PolicyPdpNotificationData data = dataList.iterator().next();
+        assertEquals(policyId, data.getPolicyId());
+        assertEquals(type, data.getPolicyType());
+        assertEquals("[pdp_1, pdp_2]", new TreeSet<>(data.getPdps()).toString());
+    }
+
     private PdpUpdate makeUpdate(String pdpName) {
         PdpUpdate update = new PdpUpdate();
 
@@ -586,4 +654,9 @@
     private String getName(Pair<PdpUpdate, PdpStateChange> pair) {
         return (pair.getKey() != null ? pair.getKey().getName() : pair.getValue().getName());
     }
+
+    @FunctionalInterface
+    private static interface TrackEx {
+        public void accept(ToscaPolicyIdentifier policyId, Collection<String> pdps) throws PfModelException;
+    }
 }
diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java
index 13c0609..19668b3 100644
--- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java
+++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java
@@ -36,6 +36,8 @@
 import org.onap.policy.pap.main.PapConstants;
 import org.onap.policy.pap.main.PolicyPapException;
 import org.onap.policy.pap.main.comm.PdpModifyRequestMap;
+import org.onap.policy.pap.main.comm.PdpTracker;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
 import org.onap.policy.pap.main.parameters.CommonTestData;
 import org.onap.policy.pap.main.parameters.PapParameterGroup;
 import org.onap.policy.pap.main.parameters.PapParameterHandler;
@@ -92,6 +94,8 @@
         assertNotNull(Registry.get(PapConstants.REG_PDP_MODIFY_LOCK, Object.class));
         assertNotNull(Registry.get(PapConstants.REG_STATISTICS_MANAGER, PapStatisticsManager.class));
         assertNotNull(Registry.get(PapConstants.REG_PDP_MODIFY_MAP, PdpModifyRequestMap.class));
+        assertNotNull(Registry.get(PapConstants.REG_PDP_TRACKER, PdpTracker.class));
+        assertNotNull(Registry.get(PapConstants.REG_POLICY_NOTIFIER, PolicyNotifier.class));
 
         // repeat - should throw an exception
         assertThatIllegalStateException().isThrownBy(() -> activator.start());
@@ -109,6 +113,8 @@
         assertNull(Registry.getOrDefault(PapConstants.REG_PDP_MODIFY_LOCK, Object.class, null));
         assertNull(Registry.getOrDefault(PapConstants.REG_STATISTICS_MANAGER, PapStatisticsManager.class, null));
         assertNull(Registry.getOrDefault(PapConstants.REG_PDP_MODIFY_MAP, PdpModifyRequestMap.class, null));
+        assertNull(Registry.getOrDefault(PapConstants.REG_PDP_TRACKER, PdpTracker.class, null));
+        assertNull(Registry.getOrDefault(PapConstants.REG_POLICY_NOTIFIER, PolicyNotifier.class, null));
 
         // repeat - should throw an exception
         assertThatIllegalStateException().isThrownBy(() -> activator.stop());
diff --git a/main/src/test/resources/e2e/PapConfigParameters.json b/main/src/test/resources/e2e/PapConfigParameters.json
index 0c86e8f..17507bd 100644
--- a/main/src/test/resources/e2e/PapConfigParameters.json
+++ b/main/src/test/resources/e2e/PapConfigParameters.json
@@ -37,6 +37,10 @@
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "noop"
+        },{
+            "topic" : "POLICY-NOTIFICATION",
+            "servers" : [ "message-router" ],
+            "topicCommInfrastructure" : "noop"
         }]
     }
 }
diff --git a/main/src/test/resources/parameters/PapConfigParameters.json b/main/src/test/resources/parameters/PapConfigParameters.json
index f3dc775..1131502 100644
--- a/main/src/test/resources/parameters/PapConfigParameters.json
+++ b/main/src/test/resources/parameters/PapConfigParameters.json
@@ -37,6 +37,10 @@
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "noop"
+        },{
+            "topic" : "POLICY-NOTIFICATION",
+            "servers" : [ "message-router" ],
+            "topicCommInfrastructure" : "noop"
         }]
     }
 }
diff --git a/main/src/test/resources/parameters/PapConfigParametersStd.json b/main/src/test/resources/parameters/PapConfigParametersStd.json
index 309bdb0..828c1a4 100644
--- a/main/src/test/resources/parameters/PapConfigParametersStd.json
+++ b/main/src/test/resources/parameters/PapConfigParametersStd.json
@@ -37,6 +37,10 @@
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "noop"
+        },{
+            "topic" : "POLICY-NOTIFICATION",
+            "servers" : [ "message-router" ],
+            "topicCommInfrastructure" : "noop"
         }]
     }
 }
diff --git a/main/src/test/resources/simpleDeploy/createGroupsDelPolicy.json b/main/src/test/resources/simpleDeploy/createGroupsDelPolicy.json
new file mode 100644
index 0000000..8972997
--- /dev/null
+++ b/main/src/test/resources/simpleDeploy/createGroupsDelPolicy.json
@@ -0,0 +1,43 @@
+{
+    "groups": [
+        {
+            "name": "groupA",
+            "version": "200.2.3",
+            "description": "my description",
+            "pdpGroupState": "ACTIVE",
+            "properties": {
+                "hello": "world"
+            },
+            "pdpSubgroups": [
+                {
+                    "pdpType": "pdpTypeA",
+                    "desiredInstanceCount": 1,
+                    "properties": {
+                        "abc": "def"
+                    },
+                    "supportedPolicyTypes": [
+                        {
+                            "name": "typeA",
+                            "version": "100.2.3"
+                        }
+                    ],
+                    "pdpInstances": [
+                        {
+                            "instanceId": "pdpA"
+                        }
+                    ],
+                    "policies": [
+                        {
+                            "name": "policyA",
+                            "version": "1.2.3"
+                        },
+                        {
+                            "name": "ToBeDeleted",
+                            "version": "1.2.3"
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
diff --git a/main/src/test/resources/simpleDeploy/daoPolicyListDelPolicy.json b/main/src/test/resources/simpleDeploy/daoPolicyListDelPolicy.json
new file mode 100644
index 0000000..155912c
--- /dev/null
+++ b/main/src/test/resources/simpleDeploy/daoPolicyListDelPolicy.json
@@ -0,0 +1,10 @@
+{
+    "policies":  [
+        {
+            "name": "ToBeDeleted",
+            "version": "1.2.3",
+            "type": "typeA",
+            "type_version": "100.2.3"
+        }
+    ]
+}
