*/
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;
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);