From: Gilles Thouenon Date: Thu, 23 Feb 2023 11:38:27 +0000 (+0100) Subject: Use NetworkTransactionService to access to the DS X-Git-Tag: 7.0.0~25^2~3 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=commitdiff_plain;h=3bf94c80a118994e8fa2460e749a7dfe270ea246;hp=bb8469e32f0909adfe44c609980a58f248519f7d Use NetworkTransactionService to access to the DS Adapt one GNPy UT to use NetworkTransactionService instead of managing the transaction directly from a new databroker, since this dependency is injected and available. JIRA: TRNSPRTPCE-727 Signed-off-by: Gilles Thouenon Change-Id: Ifafa74b69918f584b9a715e55b3140650b615013 --- diff --git a/pce/src/test/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImplTest.java b/pce/src/test/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImplTest.java index e6bc8d7c3..d308e86f8 100644 --- a/pce/src/test/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImplTest.java +++ b/pce/src/test/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImplTest.java @@ -28,7 +28,6 @@ import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; 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; @@ -132,9 +131,8 @@ public class GnpyUtilitiesImplTest extends AbstractTest { throws InterruptedException, ExecutionException { InstanceIdentifier 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