Bug 5212 - Neutron-mapper has dependency on Ofoverlay renderer
[groupbasedpolicy.git] / renderers / ofoverlay / src / test / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / endpoint / MockEndpointManager.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.endpoint;
10
11 import java.util.Collection;
12 import java.util.HashMap;
13 import java.util.Map;
14
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.Endpoint;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Key;
18
19 /**
20  * Class for mocking up endpoints for unit tests
21  * @author readams
22  */
23 public class MockEndpointManager extends EndpointManager {
24
25     private Map<EndpointL3Key, EndpointL3> endpointsL3 = new HashMap<>();
26
27     public MockEndpointManager() {
28         super(null, null, null, null, null);
29     }
30
31     public void addEndpoint(Endpoint ep) {
32         processEndpoint(null, ep);
33     }
34
35     public void addL3Endpoint(EndpointL3 l3Ep) {
36         endpointsL3.put(l3Ep.getKey(), l3Ep);
37     }
38
39     @Override
40     protected Collection<EndpointL3> getL3Endpoints() {
41         return endpointsL3.values();
42     }
43 }