use of org.prebid.mobile.rendering.bidding.display.InterstitialController in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd.
@Test
public void onFailedAndWithWinnerBid_ExecuteInterstitialControllerLoadAd() throws IllegalAccessException {
final BidResponse mockBidResponse = mock(BidResponse.class);
final InterstitialController mockInterstitialController = mock(InterstitialController.class);
final Bid mockBid = mock(Bid.class);
final RewardedVideoEventListener spyEventListener = spy(getEventListener());
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
WhiteBox.setInternalState(mRewardedAdUnit, "mBidResponse", mockBidResponse);
WhiteBox.setInternalState(mRewardedAdUnit, "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.bidding.display.InterstitialController in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method showWhenAuctionWinnerIsPrebid_ShowPrebid.
@Test
public void showWhenAuctionWinnerIsPrebid_ShowPrebid() {
final InterstitialController mockInterstitialController = mock(InterstitialController.class);
changeInterstitialState(READY_TO_DISPLAY_PREBID);
WhiteBox.setInternalState(mInterstitialAdUnit, "mInterstitialController", mockInterstitialController);
mInterstitialAdUnit.show();
verify(mockInterstitialController, times(1)).show();
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialController in project prebid-mobile-android by prebid.
the class PrebidInterstitialAdapter method initInterstitialController.
private void initInterstitialController(Context context, String responseId) {
try {
mInterstitialController = new InterstitialController(context, mInterstitialListener);
mInterstitialController.loadAd(responseId, false);
} catch (AdException e) {
MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
}
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialController in project prebid-mobile-android by prebid.
the class PrebidRewardedVideoAdapter method initInterstitialController.
private void initInterstitialController(Context context, String responseId) {
try {
mInterstitialController = new InterstitialController(context, mInterstitialListener);
mInterstitialController.loadAd(responseId, true);
} catch (AdException e) {
MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
}
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialController 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());
}
Aggregations