Skip to content

Commit

Permalink
Add some support annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton committed Jun 22, 2016
1 parent 121c61b commit 33cffe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -19,6 +19,7 @@ repositories {
dependencies {
compile 'com.squareup.okhttp3:okhttp:3.4.0-SNAPSHOT'
compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
compile 'com.android.support:support-annotations:24.0.0'

testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.28'
Expand Down
Expand Up @@ -15,6 +15,8 @@
*/
package com.jakewharton.espresso;

import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.test.espresso.IdlingResource;
import okhttp3.Dispatcher;
import okhttp3.OkHttpClient;
Expand All @@ -25,7 +27,9 @@ public final class OkHttp3IdlingResource implements IdlingResource {
* Create a new {@link IdlingResource} from {@code client} as {@code name}. You must register
* this instance using {@code Espresso.registerIdlingResources}.
*/
public static OkHttp3IdlingResource create(String name, OkHttpClient client) {
@CheckResult @NonNull
@SuppressWarnings("ConstantConditions") // Extra guards as a library.
public static OkHttp3IdlingResource create(@NonNull String name, @NonNull OkHttpClient client) {
if (name == null) throw new NullPointerException("name == null");
if (client == null) throw new NullPointerException("client == null");
return new OkHttp3IdlingResource(name, client.dispatcher());
Expand Down

0 comments on commit 33cffe9

Please sign in to comment.