NetworkImageView extends ImageView { @MainThread public void setImageUrl(String url, ImageLoader imageLoader) { Threads.throwIfNotOnMainThread(); mUrl = url; mImageLoader = imageLoader; loadImageIfNecessary( false); } NetworkImageView(Context context);  NetworkImageView(Context context, AttributeSet attrs);  NetworkImageView(Context context, AttributeSet attrs, int defStyle); @MainThread void setImageUrl(String url, ImageLoader imageLoader); void setDefaultImageResId(int defaultImage); void setDefaultImageDrawable(@Nullable Drawable defaultImageDrawable); void setDefaultImageBitmap(Bitmap defaultImage); void setErrorImageResId(int errorImage); void setErrorImageDrawable(@Nullable Drawable errorImageDrawable); void setErrorImageBitmap(Bitmap errorImage);  }
@Test public void setImageUrl_requestsImage() { mNIV.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); mNIV.setImageUrl("http: assertEquals("http: assertEquals(0, mMockImageLoader.lastMaxWidth); assertEquals(0, mMockImageLoader.lastMaxHeight); }