/* * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package test.mock.util; import com.google.common.util.concurrent.ListenableFuture; import java.util.ArrayList; import java.util.List; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutputBuilder; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; public class SalGroupServiceMock implements SalGroupService { private final List addGroupCalls = new ArrayList<>(); private final List removeGroupCalls = new ArrayList<>(); private final List updateGroupCalls = new ArrayList<>(); @Override public ListenableFuture> addGroup(AddGroupInput input) { addGroupCalls.add(input); return RpcResultBuilder.success(new AddGroupOutputBuilder().build()).buildFuture(); } @Override public ListenableFuture> removeGroup(RemoveGroupInput input) { removeGroupCalls.add(input); return RpcResultBuilder.success(new RemoveGroupOutputBuilder().build()).buildFuture(); } @Override public ListenableFuture> updateGroup(UpdateGroupInput input) { updateGroupCalls.add(input); return RpcResultBuilder.success(new UpdateGroupOutputBuilder().build()).buildFuture(); } public List getAddGroupCalls() { return addGroupCalls; } public List getRemoveGroupCalls() { return removeGroupCalls; } public List getUpdateGroupCalls() { return updateGroupCalls; } }