Move FRM tests
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / org / opendaylight / openflowplugin / applications / frm / impl / SalBundleServiceMock.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.openflowplugin.applications.frm.impl;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.ArrayList;
12 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesInput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.AddBundleMessagesOutputBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleInput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.ControlBundleOutputBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
20 import org.opendaylight.yangtools.yang.common.RpcResult;
21 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
22
23 public class SalBundleServiceMock implements SalBundleService {
24
25     private final List<ControlBundleInput> controlBundleInput = new ArrayList<>();
26     private final List<AddBundleMessagesInput>  addBundleMessagesInput = new ArrayList<>();
27
28     @Override
29     public ListenableFuture<RpcResult<ControlBundleOutput>> controlBundle(ControlBundleInput input) {
30         getControlBundleInput().add(input);
31         return RpcResultBuilder.success(new ControlBundleOutputBuilder().build()).buildFuture();
32     }
33
34     @Override
35     public ListenableFuture<RpcResult<AddBundleMessagesOutput>> addBundleMessages(AddBundleMessagesInput input) {
36         getAddBundleMessagesInput().add(input);
37         return RpcResultBuilder.success(new AddBundleMessagesOutputBuilder().build()).buildFuture();
38     }
39
40     public List<ControlBundleInput> getControlBundleInput() {
41         return controlBundleInput;
42     }
43
44     public List<AddBundleMessagesInput> getAddBundleMessagesInput() {
45         return addBundleMessagesInput;
46     }
47 }