2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.genius.datastoreutils.testutils;
10 import com.google.inject.AbstractModule;
11 import org.opendaylight.mdsal.binding.api.DataBroker;
12 import org.opendaylight.mdsal.binding.testutils.DataBrokerTestModule;
15 * Guice Module which correctly binds the {@link DataBrokerFailures}.
17 * @author Michael Vorburger.ch
19 public class DataBrokerFailuresModule extends AbstractModule {
21 private final DataBroker realDataBroker;
23 public DataBrokerFailuresModule(DataBroker realDataBroker) {
24 this.realDataBroker = realDataBroker;
27 public DataBrokerFailuresModule() throws Exception {
28 this(DataBrokerTestModule.dataBroker());
32 protected void configure() {
33 DataBrokerFailuresImpl testableDataBroker = new DataBrokerFailuresImpl(realDataBroker);
34 bind(DataBroker.class).toInstance(testableDataBroker);
35 // bind(DataBroker.class).annotatedWith(Reference.class).toInstance(testableDataBroker);
36 bind(DataBrokerFailures.class).toInstance(testableDataBroker);