+ def 'Update Bookstore node leaves' () {
+ given: 'a DMI registry model'
+ setupSchemaSetMocks('bookstore.yang')
+ and: 'the expected json string'
+ def jsonData = '{"categories":[{"code":01,"name":"Romance"}]}'
+ when: 'update data method is invoked with json data and parent node xpath'
+ objectUnderTest.updateNodeLeavesAndExistingDescendantLeaves(dataspaceName, anchorName,
+ '/bookstore', jsonData, observedTimestamp)
+ then: 'the persistence service method is invoked with correct parameters'
+ 1 * mockCpsDataPersistenceService.updateDataLeaves(dataspaceName, anchorName,
+ "/bookstore/categories[@code='01']", ['name':'Romance', 'code': '01'])
+ and: 'the data updated event is sent to the notification service'
+ 1 * mockNotificationService.processDataUpdatedEvent(anchor, observedTimestamp, '/bookstore', Operation.UPDATE)
+ }
+