Add missing license headers
[groupbasedpolicy.git] / renderers / faas / src / test / java / org / opendaylight / groupbasedpolicy / renderer / faas / FaasEndpointAugCovrgTest.java
1 /*
2  * Copyright (c) 2016 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 package org.opendaylight.groupbasedpolicy.renderer.faas;
9
10 import static org.mockito.Mockito.mock;
11 import static org.mockito.Mockito.when;
12
13 import org.junit.Before;
14 import org.junit.Test;
15 import org.opendaylight.groupbasedpolicy.api.EpRendererAugmentationRegistry;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.faas.faas.endpoint.rev151009.FaasEndpointContextInput;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInput;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterL3PrefixEndpointInput;
19
20 public class FaasEndpointAugCovrgTest {
21
22     EpRendererAugmentationRegistry epRendererAugmentationRegistry;
23
24     @Before
25     public void init() {
26         epRendererAugmentationRegistry = mock(EpRendererAugmentationRegistry.class);
27     }
28
29     @Test
30     public void testBuildEndpointAugmentation() throws Exception {
31         FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
32         RegisterEndpointInput registerEndpointInput = mock(RegisterEndpointInput.class);
33         FaasEndpointContextInput pix = mock(FaasEndpointContextInput.class);
34
35         when(registerEndpointInput.getAugmentation(FaasEndpointContextInput.class)).thenReturn(pix);
36         aug.buildEndpointAugmentation(registerEndpointInput);
37
38         when(registerEndpointInput.getAugmentation(FaasEndpointContextInput.class)).thenReturn(null);
39         aug.buildEndpointAugmentation(registerEndpointInput);
40         aug.close();
41     }
42
43     @Test
44     public void testBuildEndpointL3Augmentation() throws Exception {
45         FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
46         RegisterEndpointInput registerEndpointInput = mock(RegisterEndpointInput.class);
47
48         aug.buildEndpointL3Augmentation(registerEndpointInput);
49         aug.close();
50     }
51
52     @Test
53     public void testBuildL3PrefixEndpointAugmentation() throws Exception {
54         FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
55         RegisterL3PrefixEndpointInput registerL3PrefixEndpointInput = mock(RegisterL3PrefixEndpointInput.class);
56
57         aug.buildL3PrefixEndpointAugmentation(registerL3PrefixEndpointInput);
58         aug.close();
59     }
60
61 }