@Test public void testUpdateForwarding() throws Exception { ForwardingByTenant forwardingByTenant = new ForwardingByTenantBuilder().setTenantId(TENANT_ID_1).build(); InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid = IidFactory.forwardingByTenantIid(TENANT_ID_1); fwdResolver.updateForwarding(forwardingByTenantIid, forwardingByTenant); ReadOnlyTransaction rTx = getDataBroker().newReadOnlyTransaction(); Optional<ForwardingByTenant> potenatialFwdByTenant = rTx.read(LogicalDatastoreType.OPERATIONAL, forwardingByTenantIid).get(); Assert.assertTrue(potenatialFwdByTenant.isPresent()); Assert.assertEquals(forwardingByTenant, potenatialFwdByTenant.get()); }
@VisibleForTesting void updateForwarding(InstanceIdentifier<ForwardingByTenant> rootIdentifier, ForwardingByTenant forwardingByTenant) { Preconditions.checkNotNull(rootIdentifier); Preconditions.checkNotNull(forwardingByTenant); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, rootIdentifier, forwardingByTenant); wTx.submit(); }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @VisibleForTesting void updateForwarding(InstanceIdentifier<ForwardingByTenant> rootIdentifier, ForwardingByTenant forwardingByTenant) { Preconditions.checkNotNull(rootIdentifier); Preconditions.checkNotNull(forwardingByTenant); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, rootIdentifier, forwardingByTenant); wTx.submit(); } }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @VisibleForTesting void updateForwarding(InstanceIdentifier<ForwardingByTenant> rootIdentifier, ForwardingByTenant forwardingByTenant) { Preconditions.checkNotNull(rootIdentifier); Preconditions.checkNotNull(forwardingByTenant); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, rootIdentifier, forwardingByTenant); wTx.submit(); } ForwardingResolver(DataBroker dataProvider); }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @VisibleForTesting void updateForwarding(InstanceIdentifier<ForwardingByTenant> rootIdentifier, ForwardingByTenant forwardingByTenant) { Preconditions.checkNotNull(rootIdentifier); Preconditions.checkNotNull(forwardingByTenant); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, rootIdentifier, forwardingByTenant); wTx.submit(); } ForwardingResolver(DataBroker dataProvider);  }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @VisibleForTesting void updateForwarding(InstanceIdentifier<ForwardingByTenant> rootIdentifier, ForwardingByTenant forwardingByTenant) { Preconditions.checkNotNull(rootIdentifier); Preconditions.checkNotNull(forwardingByTenant); WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, rootIdentifier, forwardingByTenant); wTx.submit(); } ForwardingResolver(DataBroker dataProvider);   }