X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDataTreeChangeListenerProxyTest.java;h=2b99bfa5820380d27606c83b73a508f2095a6194;hb=0c8b6461924eef198c1e2d410554b3a0a138b9b7;hp=927f9297979453589d2e2fa59c96ce82910df3c1;hpb=e78622411319748472b5d9edab14eb6dc92cf6b1;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxyTest.java index 927f929797..2b99bfa582 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxyTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.junit.Test; import org.mockito.stubbing.Answer; +import org.opendaylight.controller.cluster.common.actor.Dispatchers; import org.opendaylight.controller.cluster.datastore.config.Configuration; import org.opendaylight.controller.cluster.datastore.exceptions.NotInitializedException; import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistration; @@ -36,7 +37,6 @@ import org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener; import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply; import org.opendaylight.controller.cluster.datastore.utils.ActorContext; -import org.opendaylight.controller.cluster.datastore.utils.Dispatchers; import org.opendaylight.controller.cluster.raft.utils.DoNothingActor; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.controller.md.sal.dom.api.ClusteredDOMDataTreeChangeListener; @@ -60,13 +60,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest { final DataTreeChangeListenerProxy proxy = new DataTreeChangeListenerProxy<>( actorContext, mockListener, path); - new Thread() { - @Override - public void run() { - proxy.init("shard-1"); - } - - }.start(); + new Thread(() -> proxy.init("shard-1")).start(); FiniteDuration timeout = duration("5 seconds"); FindLocalShard findLocalShard = expectMsgClass(timeout, FindLocalShard.class); @@ -119,13 +113,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest { final DataTreeChangeListenerProxy proxy = new DataTreeChangeListenerProxy<>(actorContext, mockClusteredListener, path); - new Thread() { - @Override - public void run() { - proxy.init("shard-1"); - } - - }.start(); + new Thread(() -> proxy.init("shard-1")).start(); FiniteDuration timeout = duration("5 seconds"); FindLocalShard findLocalShard = expectMsgClass(timeout, FindLocalShard.class); @@ -154,13 +142,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest { final DataTreeChangeListenerProxy proxy = new DataTreeChangeListenerProxy<>( actorContext, mockListener, path); - new Thread() { - @Override - public void run() { - proxy.init("shard-1"); - } - - }.start(); + new Thread(() -> proxy.init("shard-1")).start(); FiniteDuration timeout = duration("5 seconds"); FindLocalShard findLocalShard = expectMsgClass(timeout, FindLocalShard.class); @@ -186,13 +168,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest { final DataTreeChangeListenerProxy proxy = new DataTreeChangeListenerProxy<>( actorContext, mockListener, path); - new Thread() { - @Override - public void run() { - proxy.init("shard-1"); - } - - }.start(); + new Thread(() -> proxy.init("shard-1")).start(); FiniteDuration timeout = duration("5 seconds"); FindLocalShard findLocalShard = expectMsgClass(timeout, FindLocalShard.class);