Migrate yang-common to JUnit5
[yangtools.git] / common / yang-common / src / test / java / org / opendaylight / yangtools / yang / common / YangNamesTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. 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.yangtools.yang.common;
9
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertThrows;
12
13 import java.util.AbstractMap.SimpleImmutableEntry;
14 import org.junit.jupiter.api.Test;
15
16 public class YangNamesTest {
17     @Test
18     public void testParseFileName() {
19         assertEquals(new SimpleImmutableEntry<>("foo", null), YangNames.parseFilename("foo"));
20         assertEquals(new SimpleImmutableEntry<>("foo", "bar"), YangNames.parseFilename("foo@bar"));
21         assertEquals(new SimpleImmutableEntry<>("foo@bar", "baz"), YangNames.parseFilename("foo@bar@baz"));
22     }
23
24     @Test
25     public void testParseFileNameNull() {
26         assertThrows(NullPointerException.class, () -> YangNames.parseFilename(null));
27     }
28 }