2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. 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.netconf.sal.rest.doc.impl;
10 import static org.junit.Assert.assertNotNull;
12 import com.fasterxml.jackson.databind.node.ObjectNode;
13 import java.io.IOException;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.common.Revision;
17 public final class DefinitionGeneratorTest extends AbstractApiDocTest {
19 public void testConvertToJsonSchema() throws IOException {
20 final var module = CONTEXT.findModule("opflex", Revision.of("2014-05-28")).orElseThrow();
21 final DefinitionGenerator generator = new DefinitionGenerator();
22 final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(), true);
23 assertNotNull(jsonObject);
27 public void testActionTypes() throws IOException {
28 final var module = CONTEXT.findModule("action-types").orElseThrow();
29 final DefinitionGenerator generator = new DefinitionGenerator();
30 final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(), true);
31 assertNotNull(jsonObject);
35 public void testStringTypes() throws IOException {
36 final var module = CONTEXT.findModule("string-types").orElseThrow();
37 final DefinitionGenerator generator = new DefinitionGenerator();
38 final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(), true);
39 assertNotNull(jsonObject);