Use NetworkTransactionService to access to the DS
[transportpce.git] / pce / src / test / java / org / opendaylight / transportpce / pce / gnpy / GnpyUtilitiesImplTest.java
index 063addcbfa41c94d3b0045fcf8651d014f6959f8..d308e86f845146797f847e3bc71de1998f30f234 100644 (file)
@@ -27,13 +27,10 @@ import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
-import org.opendaylight.mdsal.binding.api.WriteTransaction;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.NetworkUtils;
 import org.opendaylight.transportpce.common.network.NetworkTransactionImpl;
-import org.opendaylight.transportpce.common.network.RequestProcessor;
 import org.opendaylight.transportpce.pce.constraints.PceConstraints;
 import org.opendaylight.transportpce.pce.constraints.PceConstraintsCalc;
 import org.opendaylight.transportpce.pce.gnpy.consumer.GnpyConsumer;
@@ -73,7 +70,7 @@ public class GnpyUtilitiesImplTest extends AbstractTest {
     private GnpyConsumer gnpyConsumer;
 
     public GnpyUtilitiesImplTest() throws IOException {
-        networkTransaction = new NetworkTransactionImpl(new RequestProcessor(getDataBroker()));
+        networkTransaction = new NetworkTransactionImpl(getDataBroker());
         JsonReader networkReader = null;
         JsonReader topoReader = null;
 
@@ -134,9 +131,8 @@ public class GnpyUtilitiesImplTest extends AbstractTest {
             throws InterruptedException, ExecutionException {
         InstanceIdentifier<Network> nwInstanceIdentifier = InstanceIdentifier.builder(Networks.class)
                 .child(Network.class, new NetworkKey(new NetworkId(networkId))).build();
-        WriteTransaction dataWriteTransaction = getDataBroker().newWriteOnlyTransaction();
-        dataWriteTransaction.put(LogicalDatastoreType.CONFIGURATION, nwInstanceIdentifier, network);
-        dataWriteTransaction.commit().get();
+        networkTransaction.put(LogicalDatastoreType.CONFIGURATION, nwInstanceIdentifier, network);
+        networkTransaction.commit().get();
     }
 
     @Test
@@ -148,7 +144,6 @@ public class GnpyUtilitiesImplTest extends AbstractTest {
 
     }
 
-    @Ignore
     @Test
     public void askNewPathFromGnpyTest() throws Exception {
         gnpyUtilitiesImpl = new GnpyUtilitiesImpl(networkTransaction,