X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDataTreeChangeListenerSupportTest.java;h=aee744e2484d861af6a52ce9b17a9863882605f0;hp=0a435fe010b844ec62c4bc4f6219b91d6da13e90;hb=33877f41ffc3f8eb36ad8490315419b90817d26e;hpb=e9fc7e7ed2b13d274518d6a872ab67749ef4507a diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupportTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupportTest.java index 0a435fe010..aee744e248 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupportTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupportTest.java @@ -26,6 +26,7 @@ import akka.pattern.Patterns; import akka.testkit.TestActorRef; import akka.testkit.javadsl.TestKit; import akka.util.Timeout; +import java.time.Duration; import java.util.AbstractMap.SimpleEntry; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; @@ -42,7 +43,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import scala.concurrent.Await; -import scala.concurrent.duration.Duration; +import scala.concurrent.duration.FiniteDuration; /** * Unit tests for DataTreeChangeListenerSupport. @@ -93,7 +94,7 @@ public class DataTreeChangeListenerSupportTest extends AbstractShardTest { listener.reset(1); TestKit kit = new TestKit(getSystem()); entry.getValue().tell(CloseDataTreeNotificationListenerRegistration.getInstance(), kit.getRef()); - kit.expectMsgClass(kit.duration("5 seconds"), CloseDataTreeNotificationListenerRegistrationReply.class); + kit.expectMsgClass(Duration.ofSeconds(5), CloseDataTreeNotificationListenerRegistrationReply.class); writeToStore(shard.getDataStore(), TEST_PATH, ImmutableNodes.containerNode(TEST_QNAME)); listener.verifyNoNotifiedData(TEST_PATH); @@ -164,7 +165,7 @@ public class DataTreeChangeListenerSupportTest extends AbstractShardTest { try { reply = (RegisterDataTreeNotificationListenerReply) Await.result(Patterns.ask(shardActor, new RegisterDataTreeChangeListener(path, dclActor, false), - new Timeout(5, TimeUnit.SECONDS)), Duration.create(5, TimeUnit.SECONDS)); + new Timeout(5, TimeUnit.SECONDS)), FiniteDuration.create(5, TimeUnit.SECONDS)); } catch (RuntimeException e) { throw e; } catch (Exception e) {