2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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
8 package org.opendaylight.restconf.nb.rfc8040.rests.services.impl;
10 import static org.junit.Assert.assertEquals;
12 import org.junit.BeforeClass;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
16 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
17 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
18 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
20 public class Netconf822Test {
21 private static final Absolute NEW1 = Absolute.of(QName.create("foo", "2021-09-30", "new1"));
23 private static EffectiveModelContext SCHEMA;
26 public static void beforeClass() {
27 SCHEMA = YangParserTestUtils.parseYangResourceDirectory("/nc822");
31 public void testOperationsContentJSON() {
34 "ietf-restconf:operations" : {
38 }""", OperationsContent.JSON.bodyFor(SchemaInferenceStack.of(SCHEMA).toInference()));
42 public void testOperationsContentByIdentifierJSON() {
45 "ietf-restconf:operations" : {
48 }""", OperationsContent.JSON.bodyFor(SchemaInferenceStack.of(SCHEMA, NEW1).toInference()));
52 public void testOperationsContentXML() {
54 <?xml version="1.0" encoding="UTF-8"?>
55 <operations xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"
59 </operations>""", OperationsContent.XML.bodyFor(SchemaInferenceStack.of(SCHEMA).toInference()));
63 public void testOperationsContentByIdentifierXML() {
65 <?xml version="1.0" encoding="UTF-8"?>
66 <operations xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"
69 </operations>""", OperationsContent.XML.bodyFor(SchemaInferenceStack.of(SCHEMA, NEW1).toInference()));