@Test public void testHandleChange() throws Exception { filterListener.handleChange(Collections.singletonList( getObjectModification(DataObjectModification.ModificationType.WRITE, getSxpFilter(5), getSxpFilter(4))), LogicalDatastoreType.OPERATIONAL, getIdentifier()); verify(writeTransaction, never()) .put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); verify(writeTransaction, never()) .merge(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); filterListener.handleChange(Collections.singletonList( getObjectModification(DataObjectModification.ModificationType.WRITE, null, getSxpFilter(5))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); filterListener.handleChange(Collections.singletonList( getObjectModification(DataObjectModification.ModificationType.WRITE, getSxpFilter(5), getSxpFilter(6))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction) .merge(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); filterListener.handleChange(Collections.singletonList( getObjectModification(DataObjectModification.ModificationType.DELETE, getSxpFilter(5), getSxpFilter(6))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction, times(1)).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); }
@Override protected InstanceIdentifier<SxpFilter> getIdentifier(SxpFilter d, InstanceIdentifier<SxpPeerGroup> parentIdentifier) { return parentIdentifier.child(SxpFilter.class, new SxpFilterKey(d.getFilterSpecific(), d.getFilterType())); }
FilterListener extends ContainerListener<SxpPeerGroup, SxpFilter> { @Override protected InstanceIdentifier<SxpFilter> getIdentifier(SxpFilter d, InstanceIdentifier<SxpPeerGroup> parentIdentifier) { return parentIdentifier.child(SxpFilter.class, new SxpFilterKey(d.getFilterSpecific(), d.getFilterType())); } }
FilterListener extends ContainerListener<SxpPeerGroup, SxpFilter> { @Override protected InstanceIdentifier<SxpFilter> getIdentifier(SxpFilter d, InstanceIdentifier<SxpPeerGroup> parentIdentifier) { return parentIdentifier.child(SxpFilter.class, new SxpFilterKey(d.getFilterSpecific(), d.getFilterType())); } FilterListener(DatastoreAccess datastoreAccess); }
FilterListener extends ContainerListener<SxpPeerGroup, SxpFilter> { @Override protected InstanceIdentifier<SxpFilter> getIdentifier(SxpFilter d, InstanceIdentifier<SxpPeerGroup> parentIdentifier) { return parentIdentifier.child(SxpFilter.class, new SxpFilterKey(d.getFilterSpecific(), d.getFilterType())); } FilterListener(DatastoreAccess datastoreAccess);  }
FilterListener extends ContainerListener<SxpPeerGroup, SxpFilter> { @Override protected InstanceIdentifier<SxpFilter> getIdentifier(SxpFilter d, InstanceIdentifier<SxpPeerGroup> parentIdentifier) { return parentIdentifier.child(SxpFilter.class, new SxpFilterKey(d.getFilterSpecific(), d.getFilterType())); } FilterListener(DatastoreAccess datastoreAccess);   }