+ listenerReg.close();
+
+ IntegrationTestKit.verifyShardState(dataStore, "test-1",
+ state -> assertEquals("getDataChangeListenerActors", 0,
+ state.getDataChangeListenerActors().size()));
+
+ testWriteTransaction(dataStore,
+ YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH)
+ .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2).build(),
+ ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 2));
+
+ listener.expectNoMoreChanges("Received unexpected change after close");
+ }
+ }
+ };
+ }
+
+ @Test
+ public void testDataTreeChangeListenerRegistration() throws Exception {
+ new IntegrationTestKit(getSystem(), datastoreContextBuilder) {
+ {
+ try (AbstractDataStore dataStore = setupAbstractDataStore(
+ testParameter, "testDataTreeChangeListenerRegistration", "test-1")) {
+
+ testWriteTransaction(dataStore, TestModel.TEST_PATH,
+ ImmutableNodes.containerNode(TestModel.TEST_QNAME));
+
+ final MockDataTreeChangeListener listener = new MockDataTreeChangeListener(1);
+
+ ListenerRegistration<MockDataTreeChangeListener> listenerReg = dataStore
+ .registerTreeChangeListener(TestModel.TEST_PATH, listener);