- private void writeNode(YangInstanceIdentifier path, NormalizedNode<?, ?> node) throws DataValidationFailedException {
- DataTreeModification modification = shardDataTree.getDataTree().takeSnapshot().newModification();
- modification.merge(path, node);
- modification.ready();
+ reset(mockListenerSupport);
+ writeNode(entityPath(ENTITY_TYPE, ENTITY_ID2), entityEntryWithOwner(ENTITY_ID2, null));
+ verify(mockListenerSupport).notifyEntityOwnershipListeners(ENTITY2, true, false, false);
+
+ // Clear the owner for entity 2 again - expect no change
+
+ reset(mockListenerSupport);
+ writeNode(entityPath(ENTITY_TYPE, ENTITY_ID2), entityEntryWithOwner(ENTITY_ID2, null));
+ verify(mockListenerSupport, never()).notifyEntityOwnershipListeners(any(DOMEntity.class), anyBoolean(),
+ anyBoolean(), anyBoolean());
+ }