+ def 'Delete anchor with invalid #scenario.'() {
+ when: 'delete anchor is invoked'
+ objectUnderTest.deleteAnchor(dataspaceName, anchorName)
+ then: 'a data validation exception is thrown'
+ thrown(DataValidationException)
+ and: 'delete data nodes is invoked on the data service with expected parameters'
+ 0 * mockCpsDataService.deleteDataNodes(_,_, _ as OffsetDateTime )
+ and: 'the persistence service method is invoked with same parameters to delete anchor'
+ 0 * mockCpsAdminPersistenceService.deleteAnchor(_,_)
+ where: 'the following parameters are used'
+ scenario | dataspaceName | anchorName
+ 'dataspace name' | 'dataspace names with spaces' | 'anchorName'
+ 'anchor name' | 'dataspaceName' | 'anchor name with spaces'
+ 'dataspace and anchor name' | 'dataspace name with spaces' | 'anchor name with spaces'
+ }
+