@Test public void testOnServiceFunctionCreated() throws Exception { ServiceFunction serviceFunction = build_service_function(); when(dataTreeModification.getRootNode()).thenReturn(dataObjectModification); when(dataObjectModification.getModificationType()).thenReturn(ModificationType.WRITE); when(dataObjectModification.getDataBefore()).thenReturn(null); when(dataObjectModification.getDataAfter()).thenReturn(serviceFunction); collection.add(dataTreeModification); serviceFunctionListener.onDataTreeChanged(collection); Thread.sleep(500); SftServiceFunctionName sftServiceFunctionName = SfcProviderServiceTypeAPI .readServiceFunctionTypeEntry(serviceFunction); assertNotNull(sftServiceFunctionName); assertEquals(sftServiceFunctionName.getName().getValue(), serviceFunction.getName().getValue()); assertTrue(SfcProviderServiceTypeAPI.deleteServiceFunctionTypeEntry(serviceFunction)); }
@Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); void init(); @Override void close(); @Override void add(ServiceFunction serviceFunction); @Override void remove(ServiceFunction serviceFunction); }
ServiceFunctionListener extends AbstractDataTreeChangeListener<ServiceFunction> { @Override public void add(ServiceFunction serviceFunction) { if (serviceFunction != null) { LOG.debug("Adding Service Function: {}", serviceFunction.getName()); if (!SfcProviderServiceTypeAPI.createServiceFunctionTypeEntry(serviceFunction)) { LOG.error("Failed to create Service Function: ", serviceFunction.getName()); } } } ServiceFunctionListener(final DataBroker dataBroker); void init(); @Override void close(); @Override void add(ServiceFunction serviceFunction); @Override void remove(ServiceFunction serviceFunction);  }