/** * Loads the content from the given classpath resource */ public static InputStream resource(String name) { return resource(Thread.currentThread().getContextClassLoader(), name); }
@Test public void testResourceResponse() throws IOException { interceptor.addRule() .respond(resource("sample.json")); client.newCall(new Request.Builder() .url(TEST_URL) .get() .build()) .execute(); }