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.model.api.EffectiveModelContext;
15 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
17 public class Netconf822Test {
18 private static EffectiveModelContext CONTEXT;
21 public static void beforeClass() {
22 CONTEXT = YangParserTestUtils.parseYangResourceDirectory("/nc822");
26 public void testOperationsContentJSON() {
28 + " \"ietf-restconf:operations\" : {\n"
29 + " \"foo:new\": [null]\n"
31 + "}", OperationsContent.JSON.bodyFor(CONTEXT));
35 public void testOperationsContentXML() {
36 assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
37 + "<operations xmlns=\"urn:ietf:params:xml:ns:yang:ietf-restconf\"\n"
38 + " xmlns:ns0=\"foo\" >\n"
40 + "</operations>", OperationsContent.XML.bodyFor(CONTEXT));