Use ByteBuf.readRetainedSlice()
[openflowplugin.git] / applications / forwardingrules-manager / src / test / java / org / opendaylight / openflowplugin / applications / frm / impl / CapturingRemoveMeter.java
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, s.r.o. 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.meter.service.rev130918.RemoveMeter;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutput;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutputBuilder;
17 import org.opendaylight.yangtools.yang.common.RpcResult;
18 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
19
20 final class CapturingRemoveMeter implements RemoveMeter {
21     final List<RemoveMeterInput> calls = new ArrayList<>();
22
23     @Override
24     public ListenableFuture<RpcResult<RemoveMeterOutput>> invoke(final RemoveMeterInput input) {
25         calls.add(input);
26         return RpcResultBuilder.success(new RemoveMeterOutputBuilder().build()).buildFuture();
27     }
28 }