SfcProviderServicePathAPI { public static ServiceFunctionPaths readAllServiceFunctionPaths() { ServiceFunctionPaths sfps; printTraceStart(LOG); InstanceIdentifier<ServiceFunctionPaths> sfpsIID = InstanceIdentifier.builder(ServiceFunctionPaths.class).build(); sfps = SfcDataStoreAPI.readTransactionAPI(sfpsIID, LogicalDatastoreType.CONFIGURATION); printTraceStop(LOG); return sfps; }  static List<SfpRenderedServicePath> readServicePathState(SfpName servicePathName); static boolean addRenderedPathToServicePathState(SfpName servicePathName, RspName renderedPathName); static ServiceFunctionPath readServiceFunctionPath(SfpName serviceFunctionPathName); static ServiceFunctionPaths readAllServiceFunctionPaths(); static boolean putServiceFunctionPath(ServiceFunctionPath sfp);  }
@Test public void testReadAllServiceFunctionPaths() throws Exception { SfpName sfpName1 = new SfpName("SFP1"); SfpName sfpName2 = new SfpName("SFP2"); List<ServiceFunctionPath> serviceFunctionPaths = new ArrayList<>(); ServiceFunctionPathBuilder serviceFunctionPathBuilder = new ServiceFunctionPathBuilder(); serviceFunctionPathBuilder.setName(sfpName1) .setKey(new ServiceFunctionPathKey(sfpName1)) .setSymmetric(false) .setTransportType(VxlanGpe.class); serviceFunctionPaths.add(serviceFunctionPathBuilder.build()); serviceFunctionPathBuilder = new ServiceFunctionPathBuilder(); serviceFunctionPathBuilder.setName(sfpName2) .setKey(new ServiceFunctionPathKey(sfpName2)) .setSymmetric(false) .setTransportType(Gre.class); serviceFunctionPaths.add(serviceFunctionPathBuilder.build()); ServiceFunctionPathsBuilder serviceFunctionPathsBuilder = new ServiceFunctionPathsBuilder(); serviceFunctionPathsBuilder.setServiceFunctionPath(serviceFunctionPaths); ServiceFunctionPaths writtenPaths = serviceFunctionPathsBuilder.build(); InstanceIdentifier<ServiceFunctionPaths> sfpsIID = InstanceIdentifier.builder(ServiceFunctionPaths.class).build(); boolean transactionSuccessful = SfcDataStoreAPI.writePutTransactionAPI(sfpsIID, writtenPaths, LogicalDatastoreType.CONFIGURATION); assertTrue("Must be true", transactionSuccessful); ServiceFunctionPaths getPaths = SfcProviderServicePathAPI.readAllServiceFunctionPaths(); assertNotNull("Must not be null", getPaths); assertTrue(writtenPaths.getServiceFunctionPath().containsAll(getPaths.getServiceFunctionPath())); transactionSuccessful = SfcDataStoreAPI.deleteTransactionAPI(sfpsIID, LogicalDatastoreType.CONFIGURATION); assertTrue("Must be true", transactionSuccessful); }