2 * Copyright (c) 2017 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package io.fd.hc2vpp.docs.core.mock.binding;
19 import static io.fd.hc2vpp.docs.core.mock.binding.MockBindingModule.noOpProxy;
21 import com.google.inject.Provider;
22 import io.fd.hc2vpp.nat.NatModule;
23 import io.fd.vpp.jvpp.JVpp;
24 import io.fd.vpp.jvpp.JVppRegistry;
25 import io.fd.vpp.jvpp.nat.future.FutureJVppNatFacade;
26 import java.io.IOException;
29 * Use to bypass jvpp registration
31 public class MockNatModule extends NatModule {
33 public MockNatModule() {
34 super(MockJVppNatProvider.class);
37 private static class MockJVppNatProvider implements Provider<FutureJVppNatFacade> {
40 public FutureJVppNatFacade get() {
42 return new FutureJVppNatFacade(noOpProxy(JVppRegistry.class), noOpProxy(JVpp.class));
43 } catch (IOException e) {
44 throw new IllegalStateException(e);