@Test public void testURLStartsWith() throws IOException { interceptor.addRule() .get() .urlStarts("https://") .respond(TEST_RESPONSE); client.newCall(new Request.Builder() .url(TEST_URL) .get() .build()) .execute(); }
@Test(expected = AssertionError.class) public void testURLStartsWith_Fail() throws IOException { interceptor.addRule() .get() .urlStarts("http://") .respond(TEST_RESPONSE) .code(401); client.newCall(new Request.Builder() .url(TEST_URL) .get() .build()) .execute(); }