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.jaxrs;
10 import org.junit.jupiter.api.Test;
11 import org.junit.jupiter.api.extension.ExtendWith;
12 import org.mockito.junit.jupiter.MockitoExtension;
13 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
14 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
16 @ExtendWith(MockitoExtension.class)
17 class Netconf822Test extends AbstractRestconfTest {
18 private static final EffectiveModelContext MODEL_CONTEXT =
19 YangParserTestUtils.parseYangResourceDirectory("/nc822");
22 EffectiveModelContext modelContext() {
27 void testOperationsContent() {
28 final var body = assertFormattableBody(200, ar -> restconf.operationsGET(ar));
32 "ietf-restconf:operations" : {
36 }""", body::formatToJSON, true);
38 <operations xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
41 </operations>""", body::formatToXML, true);
45 void testOperationsContentByIdentifier() {
46 final var body = assertFormattableBody(200, ar -> restconf.operationsGET(apiPath("foo:new1"), ar));
49 { "foo:new1" : [null] }""", body::formatToJSON, false);
51 <new1 xmlns="foo"/>""", body::formatToXML, false);