+ @Test
+ public void testEdgeCases() throws Exception {
+ Preconditions.checkArgument(helper.getModules() != null, "No modules found");
+
+ for (Entry<File, Module> m : helper.getModules().entrySet()) {
+ if (m.getKey().getAbsolutePath().endsWith("toaster.yang")) {
+ ApiDeclaration doc = generator.getSwaggerDocSpec(m.getValue(),
+ "http://localhost:8080/restconf", "");
+ Assert.assertNotNull(doc);
+
+ //testing bugs.opendaylight.org bug 1290. UnionType model type.
+ String jsonString = doc.getModels().toString();
+ assertTrue(
+ jsonString.contains( "testUnion\":{\"type\":\"integer or string\",\"required\":false}" ) );
+ }
+ }
+ }
+