@Test public void testHandleChange() throws Exception { templateListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Listener, Version.Version4), getConnectionTemplate("1.1.1.1/32", 56, "pass", ConnectionMode.Listener, Version.Version4)))), 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)); verify(writeTransaction, never()).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); templateListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, null, getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Listener, Version.Version4)))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction).put(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); templateListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.WRITE, getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Listener, Version.Version4), getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Listener, Version.Version2)))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction) .merge(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class), any(DataObject.class)); templateListener.handleChange(Collections.singletonList(getObjectModification( getObjectModification(DataObjectModification.ModificationType.DELETE, getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Listener, Version.Version4), getConnectionTemplate("1.1.1.1/32", 55, "pass", ConnectionMode.Speaker, Version.Version4)))), LogicalDatastoreType.CONFIGURATION, getIdentifier()); verify(writeTransaction).delete(eq(LogicalDatastoreType.OPERATIONAL), any(InstanceIdentifier.class)); }
@Override protected InstanceIdentifier<ConnectionTemplate> getIdentifier(ConnectionTemplate d, InstanceIdentifier<SxpDomain> parentIdentifier) { Preconditions.checkNotNull(d); Preconditions.checkNotNull(parentIdentifier); return parentIdentifier.child(ConnectionTemplates.class) .child(ConnectionTemplate.class, new ConnectionTemplateKey(d.getTemplatePrefix())); }
ConnectionTemplateListener extends ListListener<SxpDomain, ConnectionTemplates, ConnectionTemplate> { @Override protected InstanceIdentifier<ConnectionTemplate> getIdentifier(ConnectionTemplate d, InstanceIdentifier<SxpDomain> parentIdentifier) { Preconditions.checkNotNull(d); Preconditions.checkNotNull(parentIdentifier); return parentIdentifier.child(ConnectionTemplates.class) .child(ConnectionTemplate.class, new ConnectionTemplateKey(d.getTemplatePrefix())); } }
ConnectionTemplateListener extends ListListener<SxpDomain, ConnectionTemplates, ConnectionTemplate> { @Override protected InstanceIdentifier<ConnectionTemplate> getIdentifier(ConnectionTemplate d, InstanceIdentifier<SxpDomain> parentIdentifier) { Preconditions.checkNotNull(d); Preconditions.checkNotNull(parentIdentifier); return parentIdentifier.child(ConnectionTemplates.class) .child(ConnectionTemplate.class, new ConnectionTemplateKey(d.getTemplatePrefix())); } ConnectionTemplateListener(DatastoreAccess datastoreAccess); }
ConnectionTemplateListener extends ListListener<SxpDomain, ConnectionTemplates, ConnectionTemplate> { @Override protected InstanceIdentifier<ConnectionTemplate> getIdentifier(ConnectionTemplate d, InstanceIdentifier<SxpDomain> parentIdentifier) { Preconditions.checkNotNull(d); Preconditions.checkNotNull(parentIdentifier); return parentIdentifier.child(ConnectionTemplates.class) .child(ConnectionTemplate.class, new ConnectionTemplateKey(d.getTemplatePrefix())); } ConnectionTemplateListener(DatastoreAccess datastoreAccess);  }
ConnectionTemplateListener extends ListListener<SxpDomain, ConnectionTemplates, ConnectionTemplate> { @Override protected InstanceIdentifier<ConnectionTemplate> getIdentifier(ConnectionTemplate d, InstanceIdentifier<SxpDomain> parentIdentifier) { Preconditions.checkNotNull(d); Preconditions.checkNotNull(parentIdentifier); return parentIdentifier.child(ConnectionTemplates.class) .child(ConnectionTemplate.class, new ConnectionTemplateKey(d.getTemplatePrefix())); } ConnectionTemplateListener(DatastoreAccess datastoreAccess);   }