com.jakewharton.espresso.OkHttp3IdlingResource Java Examples

The following examples show how to use com.jakewharton.espresso.OkHttp3IdlingResource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OkHttpIdlingResourceRule.java    From mockwebserver-demo with Apache License 2.0 5 votes vote down vote up
@Override
public Statement apply(final Statement base, Description description) {
  return new Statement() {
    @Override
    public void evaluate() throws Throwable {
      IdlingResource idlingResource = OkHttp3IdlingResource.create(
          "okhttp", OkHttp.getInstance());
      Espresso.registerIdlingResources(idlingResource);

      base.evaluate();

      Espresso.unregisterIdlingResources(idlingResource);
    }
  };
}
 
Example #2
Source File: IdlingResources.java    From InstantAppStarter with MIT License 4 votes vote down vote up
public static void registerOkHttp(OkHttpClient client) {
    IdlingRegistry.getInstance().register(OkHttp3IdlingResource.create("okhttp", client));
}
 
Example #3
Source File: MainActivityTest.java    From Barricade with Apache License 2.0 4 votes vote down vote up
@Before public void setup() {
  IdlingResource resource = OkHttp3IdlingResource.create("OkHttp", ApiUtils.getOkHttpClient());
  Espresso.registerIdlingResources(resource);
}
 
Example #4
Source File: RealServerTest.java    From AndroidHttpMockingExamples with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() {
    idlingResource =
            OkHttp3IdlingResource.create("OkHttp", InjectionFactory.okHttpClient);
    Espresso.registerIdlingResources(idlingResource);
}
 
Example #5
Source File: PageObject.java    From photoviewer with Apache License 2.0 4 votes vote down vote up
private void setUpIdlingResources() {
  mOkHttp3IdlingResource = OkHttp3IdlingResource.create("OkHttp", mOkHttpClient);
  Espresso.registerIdlingResources(mOkHttp3IdlingResource);
}