@Test public void intoTargetAndNotInCacheSubmitsTargetRequest() { BitmapTarget target = mockTarget(); Drawable placeHolderDrawable = mock(Drawable.class); new RequestCreator(picasso, URI_1, 0).placeholder(placeHolderDrawable).into(target); verify(target).onPrepareLoad(placeHolderDrawable); verify(picasso).enqueueAndSubmit(actionCaptor.capture()); assertThat(actionCaptor.getValue()).isInstanceOf(BitmapTargetAction.class); }
@Test public void intoTargetWithNullUriAndResourceIdSkipsAndCancels() { BitmapTarget target = mockTarget(); Drawable placeHolderDrawable = mock(Drawable.class); new RequestCreator(picasso, null, 0).placeholder(placeHolderDrawable).into(target); verify(picasso).cancelRequest(target); verify(target).onPrepareLoad(placeHolderDrawable); verifyNoMoreInteractions(picasso); }
target.onPrepareLoad(setPlaceholder ? getPlaceholderDrawable() : null); return; target.onPrepareLoad(setPlaceholder ? getPlaceholderDrawable() : null);
@Test public void intoTargetNoPlaceholderCallsWithNull() { BitmapTarget target = mockTarget(); new RequestCreator(picasso, URI_1, 0).noPlaceholder().into(target); verify(target).onPrepareLoad(null); }