2 * Copyright (c) 2014, 2017 Cisco Systems, 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.openflowplugin.applications.frm.impl;
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;
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<>();
32 public ListenableFuture<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
33 addGroupCalls.add(input);
34 return RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture();
38 public ListenableFuture<RpcResult<RemoveGroupOutput>> removeGroup(RemoveGroupInput input) {
39 removeGroupCalls.add(input);
40 return RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture();
44 public ListenableFuture<RpcResult<UpdateGroupOutput>> updateGroup(UpdateGroupInput input) {
45 updateGroupCalls.add(input);
46 return RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture();
49 public List<AddGroupInput> getAddGroupCalls() {
53 public List<RemoveGroupInput> getRemoveGroupCalls() {
54 return removeGroupCalls;
57 public List<UpdateGroupInput> getUpdateGroupCalls() {
58 return updateGroupCalls;