+ def 'Delete a schema set with an invalid #scenario.'() {
+ when: 'create dataspace method is invoked with incorrectly named dataspace'
+ objectUnderTest.deleteSchemaSet(dataspaceName, schemaSetName, CASCADE_DELETE_ALLOWED)
+ then: 'a data validation exception is thrown'
+ thrown(DataValidationException)
+ and: 'anchor deletion is called 0 times'
+ 0 * mockCpsAdminService.deleteAnchor(_, _)
+ and: 'the delete schema set persistence service method is not invoked'
+ 0 * mockCpsModulePersistenceService.deleteSchemaSet(_, _, _)
+ and: 'schema set will be removed from the cache is not invoked'
+ 0 * mockYangTextSchemaSourceSetCache.removeFromCache(_, _)
+ and: 'orphan yang resources are deleted is not invoked'
+ 0 * mockCpsModulePersistenceService.deleteUnusedYangResourceModules()
+ where: 'the following parameters are used'
+ scenario | dataspaceName | schemaSetName
+ 'dataspace name' | 'dataspace names with spaces' | 'schemaSetName'
+ 'schema set name name' | 'dataspaceName' | 'schema set name with spaces'
+ 'dataspace and schema set name' | 'dataspace name with spaces' | 'schema set name with spaces'
+ }
+