interfacemgr: Add copyright wherever missing
[vpnservice.git] / interfacemgr / interfacemgr-impl / src / test / java / org / opendaylight / vpnservice / interfacemgr / test / IfmUtilTest.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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.vpnservice.interfacemgr.test;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.mockito.Mockito.when;
13
14 import org.junit.Before;
15 import org.junit.Test;
16 import org.mockito.Mock;
17 import org.mockito.MockitoAnnotations;
18 import org.opendaylight.vpnservice.interfacemgr.IfmUtil;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
20
21 public class IfmUtilTest {
22
23     @Mock NodeConnectorId ncId;
24     MockDataChangedEvent event;
25
26     @Before
27     public void setUp() throws Exception {
28         MockitoAnnotations.initMocks(this);
29     }
30
31     @Test
32     public void testDpnConversions() {
33         String NodeId = IfmUtil.buildDpnNodeId(101L).getValue();
34         assertEquals("openflow:101", NodeId);
35         when(ncId.getValue()).thenReturn("openflow:101:11");
36         assertEquals("101",IfmUtil.getDpnFromNodeConnectorId(ncId));
37     }
38
39 }