2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.groupbasedpolicy.renderer.faas;
10 import static org.mockito.Mockito.mock;
11 import static org.mockito.Mockito.when;
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;
20 public class FaasEndpointAugCovrgTest {
22 EpRendererAugmentationRegistry epRendererAugmentationRegistry;
26 epRendererAugmentationRegistry = mock(EpRendererAugmentationRegistry.class);
30 public void testBuildEndpointAugmentation() throws Exception {
31 FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
32 RegisterEndpointInput registerEndpointInput = mock(RegisterEndpointInput.class);
33 FaasEndpointContextInput pix = mock(FaasEndpointContextInput.class);
35 when(registerEndpointInput.getAugmentation(FaasEndpointContextInput.class)).thenReturn(pix);
36 aug.buildEndpointAugmentation(registerEndpointInput);
38 when(registerEndpointInput.getAugmentation(FaasEndpointContextInput.class)).thenReturn(null);
39 aug.buildEndpointAugmentation(registerEndpointInput);
44 public void testBuildEndpointL3Augmentation() throws Exception {
45 FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
46 RegisterEndpointInput registerEndpointInput = mock(RegisterEndpointInput.class);
48 aug.buildEndpointL3Augmentation(registerEndpointInput);
53 public void testBuildL3PrefixEndpointAugmentation() throws Exception {
54 FaasEndpointAug aug = new FaasEndpointAug(epRendererAugmentationRegistry);
55 RegisterL3PrefixEndpointInput registerL3PrefixEndpointInput = mock(RegisterL3PrefixEndpointInput.class);
57 aug.buildL3PrefixEndpointAugmentation(registerL3PrefixEndpointInput);