ArpUtil Test
[genius.git] / arputil / arputil-impl / src / test / java / org / opendaylight / genius / arputil / test / ArpUtilTestModule.java
1 /*
2  * Copyright (c) 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.genius.arputil.test;
9
10 import static org.mockito.Mockito.mock;
11
12 import java.net.UnknownHostException;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
15 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
16 import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule;
17 import org.opendaylight.genius.arputil.internal.ArpUtilImpl;
18 import org.opendaylight.infrautils.inject.guice.testutils.AbstractGuiceJsr250Module;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.arputil.rev160406.OdlArputilService;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
22
23 public class ArpUtilTestModule extends AbstractGuiceJsr250Module {
24
25     @Override
26     protected void configureBindings() throws UnknownHostException {
27
28         DataBroker dataBroker = DataBrokerTestModule.dataBroker();
29         bind(DataBroker.class).toInstance(dataBroker);
30
31         TestOdlInterfaceRpcService testOdlInterfaceRpcService = TestOdlInterfaceRpcService.newInstance();
32         bind(OdlInterfaceRpcService.class).toInstance(testOdlInterfaceRpcService);
33         TestPacketProcessingService testPacketProcessingService = TestPacketProcessingService.newInstance();
34         bind(PacketProcessingService.class).toInstance(testPacketProcessingService);
35         bind(NotificationService.class).toInstance(mock(NotificationService.class));
36         bind(NotificationPublishService.class).toInstance(mock(NotificationPublishService.class));
37         bind(OdlArputilService.class).to(ArpUtilImpl.class);
38     }
39 }