blob: ef87e037bfa47e5b3549baf4f4a60a89fc64026f [file] [log] [blame]
Jian Li556709c2021-02-03 17:54:28 +09001/*
2 * Copyright 2021-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.kubevirtnetworking.util;
17
18import org.junit.Test;
19
20import static junit.framework.TestCase.assertEquals;
21import static org.onosproject.kubevirtnetworking.util.KubevirtNetworkingUtil.segmentIdHex;
22
23/**
24 * Unit tests for kubevirt networking utils.
25 */
26public final class KubevirtNetworkingUtilTest {
27
28 /**
29 * Tests the segmentIdHex method.
30 */
31 @Test
32 public void testSegmentIdHex() {
33 assertEquals("000001", segmentIdHex("1"));
34 assertEquals("00000a", segmentIdHex("10"));
35 assertEquals("ffffff", segmentIdHex("16777215"));
36 }
37}