FibDataModelWriter { static void deleteFib(AtriumFibUpdate atriumFibUpdate, DataBroker dataBroker) { WriteTransaction writeTx = dataBroker.newReadWriteTransaction(); AtriumFibEntry atriumFibEntry = atriumFibUpdate.entry(); String ipPrefix = atriumFibEntry.prefix().getIp4Prefix().toString(); FibEntryKey fibEntryKey = new FibEntryKey(ipPrefix); writeTx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(FibEntries.class).child(FibEntry.class, fibEntryKey).build()); writeTx.submit(); }    }
@Test public void testDeleteFib() { ReadWriteTransaction readWriteTx = mock(ReadWriteTransaction.class); when(dataBroker.newReadWriteTransaction()).thenReturn(readWriteTx); when(atriumFibUpdate.type()).thenReturn(AtriumFibUpdate.Type.DELETE); FibDataModelWriter.deleteFib(atriumFibUpdate, dataBroker); verify(readWriteTx, times(1)).submit(); }