Correct test package
[netconf.git] / restconf / sal-rest-docgen / src / test / java / org / opendaylight / netconf / sal / rest / doc / impl / SwaggerObjectTest.java
diff --git a/restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/SwaggerObjectTest.java b/restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/SwaggerObjectTest.java
new file mode 100644 (file)
index 0000000..461422b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.netconf.sal.rest.doc.impl;
+
+import static org.junit.Assert.assertNotNull;
+
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import java.io.IOException;
+import org.junit.Test;
+import org.opendaylight.yangtools.yang.common.Revision;
+
+public final class SwaggerObjectTest extends AbstractApiDocTest {
+    @Test
+    public void testConvertToJsonSchema() throws IOException {
+        final var module = CONTEXT.findModule("opflex", Revision.of("2014-05-28")).orElseThrow();
+        final DefinitionGenerator generator = new DefinitionGenerator();
+        final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(),
+            ApiDocServiceImpl.OAversion.V2_0, true);
+        assertNotNull(jsonObject);
+    }
+
+    @Test
+    public void testActionTypes() throws IOException {
+        final var module = CONTEXT.findModule("action-types").orElseThrow();
+        final DefinitionGenerator generator = new DefinitionGenerator();
+        final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(),
+            ApiDocServiceImpl.OAversion.V2_0, true);
+        assertNotNull(jsonObject);
+    }
+
+    @Test
+    public void testStringTypes() throws IOException {
+        final var module = CONTEXT.findModule("string-types").orElseThrow();
+        final DefinitionGenerator generator = new DefinitionGenerator();
+        final ObjectNode jsonObject = generator.convertToJsonSchema(module, CONTEXT, new DefinitionNames(),
+            ApiDocServiceImpl.OAversion.V2_0, true);
+        assertNotNull(jsonObject);
+    }
+}