+ def 'Update Bookstore node leaves with invalid #scenario' () {
+ when: 'update data method is invoked with an invalid #scenario'
+ objectUnderTest.updateNodeLeavesAndExistingDescendantLeaves(dataspaceName, anchorName,
+ '/bookstore', _ as String, observedTimestamp)
+ then: 'a data validation exception is thrown'
+ thrown(DataValidationException)
+ and: 'the persistence service method is not invoked'
+ 0 * mockCpsDataPersistenceService.updateDataLeaves(_, _, _, _)
+ and: 'the data updated event is not sent to the notification service'
+ 0 * mockNotificationService.processDataUpdatedEvent(_, _, _, _)
+ 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'
+ }
+
+