Convert DataChangeListeners to DataTreeChangeListeners
[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.Executor;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.Endpoint;
15
16 public class MockFaasEndpointManagerListener extends FaasEndpointManagerListener {
17
18     private Endpoint expectedEndpoint;
19
20     public MockFaasEndpointManagerListener(FaasPolicyManager policyManager, DataBroker dataProvider,
21             Executor executor) {
22         super(policyManager, dataProvider, executor);
23     }
24
25     // *******************************************************
26     // Test Stubs
27     // *******************************************************
28     @Override
29     protected void processEndpoint(Endpoint endpoint) {
30         if (expectedEndpoint != null) {
31             assertTrue("FaasEndpointManagerListener.processEndpoint", expectedEndpoint.equals(endpoint));
32         }
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 }