3d2f36340efca969012cc58276b2b128edb53b0c
[netconf.git] / restconf / restconf-nb / src / test / java / org / opendaylight / restconf / nb / jaxrs / RestconfYangLibraryVersionGetTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.restconf.nb.jaxrs;
9
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11
12 import org.junit.jupiter.api.Test;
13 import org.junit.jupiter.api.extension.ExtendWith;
14 import org.mockito.junit.jupiter.MockitoExtension;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev170126.Restconf;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
18 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
19 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
20
21 @ExtendWith(MockitoExtension.class)
22 class RestconfYangLibraryVersionGetTest extends AbstractRestconfTest {
23     @Override
24     EffectiveModelContext modelContext() {
25         return YangParserTestUtils.parseYangResourceDirectory("/restconf/impl");
26     }
27
28     @Test
29     void testLibraryVersion() {
30         assertEquals(ImmutableNodes.leafNode(QName.create(Restconf.QNAME, "yang-library-version"), "2019-01-04"),
31             assertNormalizedNode(200, ar -> restconf.yangLibraryVersionGET(ar)));
32     }
33 }