2 * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. 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
9 package org.opendaylight.genius.interfacemanager.test;
11 import static org.junit.Assert.assertEquals;
12 import static org.mockito.Mockito.when;
14 import java.math.BigInteger;
15 import org.junit.Before;
16 import org.junit.Test;
17 import org.mockito.Mock;
18 import org.mockito.MockitoAnnotations;
19 import org.opendaylight.genius.interfacemanager.IfmUtil;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
22 public class IfmUtilTest {
29 MockitoAnnotations.initMocks(this);
33 public void testDpnConversions() {
34 String nodeId = IfmUtil.buildDpnNodeId(BigInteger.valueOf(101)).getValue();
35 assertEquals("openflow:101", nodeId);
36 when(ncId.getValue()).thenReturn("openflow:101:11");
37 assertEquals(new BigInteger("101"), IfmUtil.getDpnFromNodeConnectorId(ncId));