Integrate controller-2.0.1
[genius.git] / cloudscaler / impl / src / test / java / org / opendaylight / genius / cloudscaler / tests / CloudScalerServiceTestModule.java
index 70051b24e0955fa8f8830ee971434fc2692176d2..8d2e5476fc8305970af2e72087b91858da9f485d 100644 (file)
@@ -7,9 +7,6 @@
  */
 package org.opendaylight.genius.cloudscaler.tests;
 
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
-import java.util.concurrent.Executors;
 import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
 import org.opendaylight.infrautils.caches.CacheProvider;
 import org.opendaylight.infrautils.caches.baseimpl.CacheManagersRegistry;
@@ -17,26 +14,13 @@ import org.opendaylight.infrautils.caches.baseimpl.internal.CacheManagersRegistr
 import org.opendaylight.infrautils.caches.guava.internal.GuavaCacheProvider;
 import org.opendaylight.infrautils.inject.guice.testutils.AbstractGuiceJsr250Module;
 import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractBaseDataBrokerTest;
-import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTestCustomizer;
+import org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule;
 
 public class CloudScalerServiceTestModule extends AbstractGuiceJsr250Module {
 
     @Override
-    protected void configureBindings() throws Exception {
-        AbstractBaseDataBrokerTest test = new AbstractBaseDataBrokerTest() {
-            @Override
-            protected AbstractDataBrokerTestCustomizer createDataBrokerTestCustomizer() {
-                return new AbstractDataBrokerTestCustomizer() {
-                    @Override
-                    public ListeningExecutorService getCommitCoordinatorExecutor() {
-                        return MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
-                    }
-                };
-            }
-        };
-        test.setup();
-        DataBroker dataBroker = test.getDataBroker();
+    protected void configureBindings() {
+        DataBroker dataBroker = DataBrokerTestModule.dataBroker();
         bind(DataBroker.class).toInstance(dataBroker);
         bind(CacheManagersRegistry.class).to(CacheManagersRegistryImpl.class);
         bind(CacheProvider.class).to(GuavaCacheProvider.class);