From 3bf94c80a118994e8fa2460e749a7dfe270ea246 Mon Sep 17 00:00:00 2001 From: Gilles Thouenon Date: Thu, 23 Feb 2023 12:38:27 +0100 Subject: [PATCH] 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 --- .../transportpce/pce/gnpy/GnpyUtilitiesImplTest.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 -- 2.36.6