### Question:
FiamImageLoader { public FiamImageRequestCreator load(@Nullable String imageUrl) { return new FiamImageRequestCreator(picasso.load(imageUrl)); } @Inject  FiamImageLoader(Picasso picasso); FiamImageRequestCreator load(@Nullable String imageUrl); void cancelTag(Class c);  }### Answer:
@Test public void load_createdFiamImageRequestCreator() { when(picasso.load(IMAGE_URL)).thenReturn(requestCreator); assertThat(imageLoader.load(IMAGE_URL).getClass()) .isEqualTo(FiamImageLoader.FiamImageRequestCreator.class); }
@Test public void placeholder_setsPlaceholderOnUnderlyingRequestCreator() { when(picasso.load(IMAGE_URL)).thenReturn(requestCreator); FiamImageLoader.FiamImageRequestCreator fiamImageRequestCreator = imageLoader.load(IMAGE_URL); fiamImageRequestCreator.placeholder(1); verify(requestCreator).placeholder(1); }
@Test public void tag_tagsUnderlyingRequestCreator() { when(picasso.load(IMAGE_URL)).thenReturn(requestCreator); FiamImageLoader.FiamImageRequestCreator fiamImageRequestCreator = imageLoader.load(IMAGE_URL); fiamImageRequestCreator.tag(String.class); verify(requestCreator).tag(String.class); }
@Test public void into_invokesUnderlyingRequestCreator() { ImageView imageView = mock(ImageView.class); Callback callback = mock(Callback.class); when(picasso.load(IMAGE_URL)).thenReturn(requestCreator); FiamImageLoader.FiamImageRequestCreator fiamImageRequestCreator = imageLoader.load(IMAGE_URL); fiamImageRequestCreator.into(imageView, callback); verify(requestCreator).into(imageView, callback); }