350e69a0aadc1f640877adcbd0adc472007e8321
[genius.git] / arputil / arputil-impl / src / test / java / org / opendaylight / genius / arputil / test / TestPacketProcessingService.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.opendaylight.yangtools.testutils.mockito.MoreAnswers.realOrException;
11
12 import com.google.common.util.concurrent.Futures;
13 import com.google.common.util.concurrent.ListenableFuture;
14
15 import org.mockito.Mockito;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketOutput;
19 import org.opendaylight.yangtools.yang.common.RpcResult;
20 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
21
22 public class TestPacketProcessingService implements PacketProcessingService {
23
24     public static TestPacketProcessingService newInstance() {
25         return Mockito.mock(TestPacketProcessingService.class, realOrException());
26     }
27
28     @Override
29     public ListenableFuture<RpcResult<TransmitPacketOutput>> transmitPacket(TransmitPacketInput input) {
30         RpcResultBuilder<TransmitPacketOutput> rpcResultBuilder = RpcResultBuilder.success();
31         return Futures.immediateFuture(rpcResultBuilder.build());
32     }
33 }