5025628c4367345d9b69caac6271cb7292f62158
[groupbasedpolicy.git] / renderers / faas / src / test / java / org / opendaylight / groupbasedpolicy / renderer / faas / MockFaasEndpointManagerListener.java
1 /*
2  * Copyright (c) 2016 Huawei Technologies 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.groupbasedpolicy.renderer.faas;
9
10 import static org.junit.Assert.assertTrue;
11
12 import java.util.concurrent.ScheduledExecutorService;
13
14 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.Endpoint;
16
17 public class MockFaasEndpointManagerListener extends FaasEndpointManagerListener {
18
19     private Endpoint expectedEndpoint;
20
21     public MockFaasEndpointManagerListener(FaasPolicyManager policyManager, DataBroker dataProvider,
22             ScheduledExecutorService executor) {
23         super(policyManager, dataProvider, executor);
24     }
25
26     // *******************************************************
27     // Test Stubs
28     // *******************************************************
29     @Override
30     protected void processEndpoint(Endpoint endpoint) {
31         if (expectedEndpoint != null)
32             assertTrue("FaasEndpointManagerListener.processEndpoint", expectedEndpoint.equals(endpoint));
33     }
34
35     // *******************************************************
36     // The following Methods are to input test data
37     // *******************************************************
38     public void setExpectedEndpoint(Endpoint testEndpoint) {
39         this.expectedEndpoint = testEndpoint;
40     }
41 }