diff --git a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceTest.java b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceTest.java
index 8455e57..050ee26 100755
--- a/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceTest.java
+++ b/cps-ri/src/test/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceTest.java
@@ -20,7 +20,11 @@
 package org.onap.cps.spi.impl;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_ALLOWED;
+import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_PROHIBITED;
 
 import com.google.common.collect.ImmutableMap;
 import java.util.Map;
@@ -36,8 +40,13 @@
 import org.onap.cps.spi.entities.YangResourceEntity;
 import org.onap.cps.spi.exceptions.DataspaceNotFoundException;
 import org.onap.cps.spi.exceptions.SchemaSetAlreadyDefinedException;
+import org.onap.cps.spi.exceptions.SchemaSetInUseException;
+import org.onap.cps.spi.exceptions.SchemaSetNotFoundException;
+import org.onap.cps.spi.repository.AnchorRepository;
 import org.onap.cps.spi.repository.DataspaceRepository;
+import org.onap.cps.spi.repository.FragmentRepository;
 import org.onap.cps.spi.repository.SchemaSetRepository;
+import org.onap.cps.spi.repository.YangResourceRepository;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.jdbc.Sql;
@@ -57,6 +66,8 @@
     private static final String DATASPACE_NAME_INVALID = "DATASPACE-X";
     private static final String SCHEMA_SET_NAME = "SCHEMA-SET-001";
     private static final String SCHEMA_SET_NAME_NEW = "SCHEMA-SET-NEW";
+    private static final String SCHEMA_SET_NAME_NO_ANCHORS = "SCHEMA-SET-100";
+    private static final String SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA = "SCHEMA-SET-101";
 
     private static final String EXISTING_RESOURCE_NAME = "module1@2020-02-02.yang";
     private static final String EXISTING_RESOURCE_CONTENT = "CONTENT-001";
@@ -68,6 +79,13 @@
     private static final String NEW_RESOURCE_CHECKSUM = "c94d40a1350eb1c0b1c1949eac84fc59";
     private static final Long NEW_RESOURCE_ABSTRACT_ID = 0L;
 
+    private static final Long SHARED_RESOURCE_ID1 = 3003L;
+    private static final Long SHARED_RESOURCE_ID2 = 3004L;
+    private static final Long ORPHAN_RESOURCE_ID = 3100L;
+    private static final Integer REMOVED_ANCHOR_ID1 = 6001;
+    private static final Integer REMOVED_ANCHOR_ID2 = 6002;
+    private static final Long REMOVED_FRAGMENT_ID = 7001L;
+
     @ClassRule
     public static DatabaseTestContainer testContainer = DatabaseTestContainer.getInstance();
 
@@ -78,11 +96,19 @@
     private CpsAdminPersistenceService cpsAdminPersistenceService;
 
     @Autowired
-    private DataspaceRepository dataspaceRepository;
+    DataspaceRepository dataspaceRepository;
 
     @Autowired
     private SchemaSetRepository schemaSetRepository;
 
+    @Autowired
+    private YangResourceRepository yangResourceRepository;
+
+    @Autowired
+    private AnchorRepository anchorRepository;
+
+    @Autowired
+    private FragmentRepository fragmentRepository;
 
     @Test(expected = DataspaceNotFoundException.class)
     @Sql(CLEAR_DATA)
@@ -92,14 +118,14 @@
     }
 
     @Test(expected = SchemaSetAlreadyDefinedException.class)
-    @SqlGroup({@Sql(CLEAR_DATA), @Sql(SET_DATA)})
+    @Sql({CLEAR_DATA, SET_DATA})
     public void testStoreDuplicateSchemaSet() {
         cpsModulePersistenceService.storeSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME,
             toMap(NEW_RESOURCE_NAME, NEW_RESOURCE_CONTENT));
     }
 
     @Test
-    @SqlGroup({@Sql(CLEAR_DATA), @Sql(SET_DATA)})
+    @Sql({CLEAR_DATA, SET_DATA})
     public void testStoreSchemaSetWithNewYangResource() {
         final Map<String, String> yangResourcesNameToContentMap = toMap(NEW_RESOURCE_NAME, NEW_RESOURCE_CONTENT);
         cpsModulePersistenceService.storeSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_NEW,
@@ -107,11 +133,11 @@
         assertSchemaSetPersisted(DATASPACE_NAME, SCHEMA_SET_NAME_NEW,
             NEW_RESOURCE_ABSTRACT_ID, NEW_RESOURCE_NAME, NEW_RESOURCE_CONTENT, NEW_RESOURCE_CHECKSUM);
         assertEquals(yangResourcesNameToContentMap,
-                cpsModulePersistenceService.getYangSchemaResources(DATASPACE_NAME, SCHEMA_SET_NAME_NEW));
+            cpsModulePersistenceService.getYangSchemaResources(DATASPACE_NAME, SCHEMA_SET_NAME_NEW));
     }
 
     @Test
-    @SqlGroup({@Sql(CLEAR_DATA), @Sql(SET_DATA)})
+    @Sql({CLEAR_DATA, SET_DATA})
     public void testGetYangResourcesWithAnchorName() {
         final Map<String, String> yangResourcesNameToContentMap =
             toMap(NEW_RESOURCE_NAME, NEW_RESOURCE_CONTENT);
@@ -124,7 +150,7 @@
     }
 
     @Test
-    @SqlGroup({@Sql(CLEAR_DATA), @Sql(SET_DATA)})
+    @Sql({CLEAR_DATA, SET_DATA})
     public void testStoreSchemaSetWithExistingYangResourceReuse() {
         cpsModulePersistenceService.storeSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_NEW,
             toMap(NEW_RESOURCE_NAME, EXISTING_RESOURCE_CONTENT));
@@ -133,9 +159,9 @@
     }
 
     private void assertSchemaSetPersisted(final String expectedDataspaceName, final String expectedSchemaSetName,
-                                          final Long expectedYangResourceId, final String expectedYangResourceName,
-                                          final String expectedYangResourceContent,
-                                          final String expectedYangResourceChecksum) {
+        final Long expectedYangResourceId, final String expectedYangResourceName,
+        final String expectedYangResourceContent,
+        final String expectedYangResourceChecksum) {
 
         // assert the schema set is persisted
         final SchemaSetEntity schemaSetEntity = getSchemaSetFromDatabase(expectedDataspaceName, expectedSchemaSetName);
@@ -159,6 +185,63 @@
         assertEquals(expectedYangResourceChecksum, yangResourceEntity.getChecksum());
     }
 
+    @Test
+    @Sql({CLEAR_DATA, SET_DATA})
+    public void testStrictDeleteSchemaSetNoAnchors() {
+        cpsModulePersistenceService.deleteSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_NO_ANCHORS,
+            CASCADE_DELETE_PROHIBITED);
+
+        // validate schema set removed
+        final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(DATASPACE_NAME);
+        assertFalse(schemaSetRepository
+            .findByDataspaceAndName(dataspaceEntity, SCHEMA_SET_NAME_NO_ANCHORS).isPresent());
+
+        // validate shared resource remain, but orphan one is removed
+        assertTrue(yangResourceRepository.findById(SHARED_RESOURCE_ID1).isPresent());
+        assertFalse(yangResourceRepository.findById(ORPHAN_RESOURCE_ID).isPresent());
+    }
+
+
+    @Test
+    @Sql({CLEAR_DATA, SET_DATA})
+    public void testFullDeleteSchemaSetWithAnchorsAndData() {
+        cpsModulePersistenceService
+            .deleteSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA, CASCADE_DELETE_ALLOWED);
+
+        // validate schema set removed
+        final DataspaceEntity dataspaceEntity = dataspaceRepository.getByName(DATASPACE_NAME);
+        assertFalse(schemaSetRepository
+            .findByDataspaceAndName(dataspaceEntity, SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA).isPresent());
+
+        // validate shared resources remain
+        assertTrue(yangResourceRepository.findById(SHARED_RESOURCE_ID1).isPresent());
+        assertTrue(yangResourceRepository.findById(SHARED_RESOURCE_ID2).isPresent());
+
+        // validate associated anchors and data are removed
+        assertFalse(anchorRepository.findById(REMOVED_ANCHOR_ID1).isPresent());
+        assertFalse(anchorRepository.findById(REMOVED_ANCHOR_ID2).isPresent());
+        assertFalse(fragmentRepository.findById(REMOVED_FRAGMENT_ID).isPresent());
+    }
+
+    @Test(expected = DataspaceNotFoundException.class)
+    @Sql(CLEAR_DATA)
+    public void testDeleteSchemaSetWithinInvalidDataspace() {
+        cpsModulePersistenceService.deleteSchemaSet(DATASPACE_NAME_INVALID, SCHEMA_SET_NAME, CASCADE_DELETE_ALLOWED);
+    }
+
+    @Test(expected = SchemaSetNotFoundException.class)
+    @Sql({CLEAR_DATA, SET_DATA})
+    public void testDeleteNonExistingSchemaSet() {
+        cpsModulePersistenceService.deleteSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_NEW, CASCADE_DELETE_ALLOWED);
+    }
+
+    @Test(expected = SchemaSetInUseException.class)
+    @Sql({CLEAR_DATA, SET_DATA})
+    public void testStrictDeleteSchemaSetInUse() {
+        cpsModulePersistenceService
+            .deleteSchemaSet(DATASPACE_NAME, SCHEMA_SET_NAME_WITH_ANCHORS_AND_DATA, CASCADE_DELETE_PROHIBITED);
+    }
+
     private static Map<String, String> toMap(final String key, final String value) {
         return ImmutableMap.<String, String>builder().put(key, value).build();
     }
diff --git a/cps-ri/src/test/resources/data/schemaset.sql b/cps-ri/src/test/resources/data/schemaset.sql
index e3fc69b..0ec1ec3 100644
--- a/cps-ri/src/test/resources/data/schemaset.sql
+++ b/cps-ri/src/test/resources/data/schemaset.sql
@@ -2,13 +2,26 @@
     (1001, 'DATASPACE-001'), (1002, 'DATASPACE-002');
 
 INSERT INTO SCHEMA_SET (ID, NAME, DATASPACE_ID) VALUES
-    (2001, 'SCHEMA-SET-001', 1001), (2002, 'SCHEMA-SET-002', 1001);
+    (2001, 'SCHEMA-SET-001', 1001), (2002, 'SCHEMA-SET-002', 1001),
+    (2100, 'SCHEMA-SET-100', 1001), -- for removal, not referenced by anchors
+    (2101, 'SCHEMA-SET-101', 1001); -- for removal, having anchor and data associated
 
 INSERT INTO YANG_RESOURCE (ID, NAME, CONTENT, CHECKSUM) VALUES
     (3001, 'module1@2020-02-02.yang', 'CONTENT-001', '877e65a9f36d54e7702c3f073f6bc42b'),
     (3002, 'module2@2020-02-02.yang', 'CONTENT-002', '88892586b1f23fe8c1595759784a18f8'),
     (3003, 'module3@2020-02-02.yang', 'CONTENT-003', 'fc5740499a09a48e0c95d6fc45d4bde8'),
-    (3004, 'module4@2020-02-02.yang', 'CONTENT-004', '3801280fe532f5cbf535695cf6122026');
+    (3004, 'module4@2020-02-02.yang', 'CONTENT-004', '3801280fe532f5cbf535695cf6122026'),
+    (3100, 'orphan@2020-02-02.yang', 'ORPHAN', 'checksum'); -- for auto-removal as orphan
 
 INSERT INTO SCHEMA_SET_YANG_RESOURCES (SCHEMA_SET_ID, YANG_RESOURCE_ID) VALUES
-    (2001, 3001), (2001, 3002), (2002, 3003), (2002, 3004);
+    (2001, 3001), (2001, 3002),
+    (2002, 3003), (2002, 3004),
+    (2100, 3003), (2100, 3100), -- orphan removal case
+    (2101, 3003), (2101, 3004);
+
+INSERT INTO ANCHOR (ID, NAME, DATASPACE_ID, SCHEMA_SET_ID) VALUES -- anchors for removal
+    (6001, 'ANCHOR1', 1001, 2101),
+    (6002, 'ANCHOR2', 1001, 2101);
+
+INSERT INTO FRAGMENT (ID, XPATH, ANCHOR_ID, DATASPACE_ID) VALUES
+    (7001, '/XPATH', 6001, 1001);
