File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/test/java/com/networknt/schema Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,24 @@ public class UriMappingTest {
40
40
private final ClasspathURLFactory classpathURLFactory = new ClasspathURLFactory ();
41
41
private final URLFactory urlFactory = new URLFactory ();
42
42
43
+ /**
44
+ * Validate URI Create API
45
+ */
46
+ @ Test
47
+ public void testUrlFactoryCreate () {
48
+ try {
49
+ this .urlFactory .create ("://example.com/invalid/schema/url" );
50
+ fail ("Invalid URI, should throw error." );
51
+ }
52
+ catch (IllegalArgumentException e ){
53
+
54
+ }
55
+ catch (Exception e ){
56
+ fail ("Unknown Exception occured " );
57
+ }
58
+
59
+ }
60
+
43
61
/**
44
62
* Validate that a JSON URI Mapping file containing the URI Mapping schema is
45
63
* schema valid.
@@ -113,7 +131,7 @@ public void testValidatorConfigUriMappingUri() throws IOException {
113
131
SchemaValidatorsConfig config = new SchemaValidatorsConfig ();
114
132
config .addUriTranslator (getUriMappingsFromUrl (mappings ));
115
133
JsonSchema schema = instance .getSchema (this .urlFactory .create (
116
- "https://raw.githubusercontent.com/networknt/json-schema-validator/master/src/test/resources/draft4/extra/uri_mapping/uri-mapping.schema.json" ),
134
+ "https://raw.githubusercontent.com/networknt/json-schema-validator/master/src/test/resources/draft4/extra/uri_mapping/uri-mapping.schema.json" ),
117
135
config );
118
136
assertEquals (0 , schema .validate (mapper .readTree (mappings )).size ());
119
137
}
You can’t perform that action at this time.
0 commit comments