File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
core/src/test/java/org/everit/json/schema/loader Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 7
7
import static org .mockito .Mockito .when ;
8
8
9
9
import java .io .InputStream ;
10
+ import java .io .UncheckedIOException ;
10
11
11
12
import org .everit .json .schema .ResourceLoader ;
12
13
import org .json .JSONObject ;
13
14
import org .json .JSONTokener ;
14
15
import org .junit .Before ;
16
+ import org .junit .Rule ;
15
17
import org .junit .Test ;
18
+ import org .junit .rules .ExpectedException ;
16
19
import org .junit .runner .RunWith ;
17
20
18
21
import junitparams .JUnitParamsRunner ;
@@ -39,6 +42,18 @@ public void delegatesUnhandledProtocolsToFallback() {
39
42
assertSame (expected , actual );
40
43
}
41
44
45
+ @ Rule
46
+ public ExpectedException exception = ExpectedException .none ();
47
+ @ Test
48
+ public void throwsErrorOnMissingClasspathResource () {
49
+ exception .expect (UncheckedIOException .class );
50
+ exception .expectMessage ("Could not find" );
51
+
52
+ String url = "classpath:/bogus.json" ;
53
+ ClassPathAwareSchemaClient subject = new ClassPathAwareSchemaClient (fallbackClient );
54
+ subject .get (url );
55
+ }
56
+
42
57
@ Test
43
58
@ Parameters ({
44
59
"classpath:/org/everit/jsonvalidator/constobject.json" ,
You can’t perform that action at this time.
0 commit comments