Move FRM tests
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / org / opendaylight / openflowplugin / applications / frm / impl / SalGroupServiceMock.java
1 /*
2  * Copyright (c) 2014, 2017 Cisco Systems, Inc. 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.group.service.rev130918.AddGroupInput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutputBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutputBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutputBuilder;
23 import org.opendaylight.yangtools.yang.common.RpcResult;
24 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
25
26 public class SalGroupServiceMock implements SalGroupService {
27     private final List<AddGroupInput> addGroupCalls = new ArrayList<>();
28     private final List<RemoveGroupInput> removeGroupCalls = new ArrayList<>();
29     private final List<UpdateGroupInput> updateGroupCalls = new ArrayList<>();
30
31     @Override
32     public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
33         addGroupCalls.add(input);
34         return RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture();
35     }
36
37     @Override
38     public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(RemoveGroupInput input) {
39         removeGroupCalls.add(input);
40         return RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture();
41     }
42
43     @Override
44     public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(UpdateGroupInput input) {
45         updateGroupCalls.add(input);
46         return RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture();
47     }
48
49     public List<AddGroupInput> getAddGroupCalls() {
50         return addGroupCalls;
51     }
52
53     public List<RemoveGroupInput> getRemoveGroupCalls() {
54         return removeGroupCalls;
55     }
56
57     public List<UpdateGroupInput> getUpdateGroupCalls() {
58         return updateGroupCalls;
59     }
60 }