fix example string generation for types with isBasicLatin pattern
[netconf.git] / restconf / sal-rest-docgen / src / test / java / org / opendaylight / controller / sal / rest / doc / impl / ModelGeneratorTest.java
index 58478425b9d4866edea4462a897ddca078e4abf4..b0d2215b0312ee2f6948fb8bc1c8e973b606a112 100644 (file)
@@ -51,4 +51,18 @@ public class ModelGeneratorTest {
         }
 
     }
+
+    @Test
+    public void testStringTypes() throws Exception {
+        Preconditions.checkArgument(this.helper.getModules() != null, "No modules found");
+        Module strTypes = this.helper.getModules().stream()
+                .filter(module -> module.getName().equals("string-types"))
+                .findFirst()
+                .orElseThrow(() -> new IllegalArgumentException("String types module not found"));
+
+        final ModelGenerator generator = new ModelGenerator();
+        final ObjectNode jsonObject = generator.convertToJsonSchema(strTypes, this.schemaContext);
+
+        Assert.assertNotNull(jsonObject);
+    }
 }