IntentServiceManager { public void removeIntent(Uuid id) { Preconditions.checkNotNull(id); InstanceIdentifier<Intent> iid = InstanceIdentifier.create(Intents.class).child(Intent.class, new IntentKey(id)); mdsal.delete(LogicalDatastoreType.CONFIGURATION, iid); LOG.info("RemoveIntent succeeded"); } IntentServiceManager(DataBroker dataBroker); void addIntent(String src, String dst, String intentAction, String failOverType); void removeIntent(Uuid id); void removeIntentsByEndpoint(String endpointGroupName); static final String ACTION_ALLOW; static final String ACTION_BLOCK; static final String FAST_REROUTE; static final String SLOW_REROUTE; }
@SuppressWarnings("unchecked") @Test public void testRemoveIntents() { Uuid id = mock(Uuid.class); when(mdsal.delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class))).thenReturn(true); intentServiceManager.removeIntent(id); verify(mdsal).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); }