use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method onFailedAndNoWinnerBid_AdStatusReadyForLoadNotifyErrorListener.
@Test
public void onFailedAndNoWinnerBid_AdStatusReadyForLoadNotifyErrorListener() {
final AdException exception = new AdException(AdException.INTERNAL_ERROR, "Test");
final InterstitialEventListener eventListener = getEventListener();
eventListener.onAdFailed(exception);
verify(mMockInterstitialAdUnitListener, times(1)).onAdFailed(mInterstitialAdUnit, exception);
assertEquals(READY_FOR_LOAD, mInterstitialAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd.
@Test
public void onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final InterstitialController mockInterstitialController = mock(InterstitialController.class);
final Bid mockBid = mock(Bid.class);
final InterstitialEventListener spyEventListener = spy(getEventListener());
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
WhiteBox.setInternalState(mInterstitialAdUnit, "mBidResponse", mockBidResponse);
WhiteBox.setInternalState(mInterstitialAdUnit, "mInterstitialController", mockInterstitialController);
spyEventListener.onAdFailed(new AdException(AdException.INTERNAL_ERROR, "Test"));
verify(spyEventListener, times(1)).onPrebidSdkWin();
verify(mockInterstitialController, times(1)).loadAd(any(), any());
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class VideoViewTest method failedToLoad_NotifyListener.
@Test
public void failedToLoad_NotifyListener() {
final AdException expectedException = new AdException(AdException.INTERNAL_ERROR, "message");
mAdViewManagerListener.failedToLoad(expectedException);
verify(mMockVideoViewListener).onLoadFailed(mVideoView, expectedException);
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class VideoViewTest method notifyErrorListeners_InvokeOnLoadFailed.
@Test
public void notifyErrorListeners_InvokeOnLoadFailed() {
AdException adException = new AdException(AdException.INTERNAL_ERROR, AdException.INIT_ERROR);
mVideoView.notifyErrorListeners(adException);
verify(mMockVideoViewListener).onLoadFailed(mVideoView, adException);
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class BaseInterstitialAdUnitTest method loadAdWithError_BidResponseIsNull.
@Test
public void loadAdWithError_BidResponseIsNull() {
BidResponse bidResponse = mBaseInterstitialAdUnit.getBidResponse();
assertNull(bidResponse);
final AdException adException = mock(AdException.class);
BidRequesterListener listener = getBidRequesterListener();
listener.onError(adException);
mBaseInterstitialAdUnit.loadAd();
bidResponse = mBaseInterstitialAdUnit.getBidResponse();
assertNull(bidResponse);
}
Aggregations