use of org.prebid.mobile.rendering.bidding.data.bid.BidResponse in project prebid-mobile-android by prebid.
the class InterstitialViewTest method loadAd_ExecuteBidTransactionLoad.
@Test
public void loadAd_ExecuteBidTransactionLoad() {
AdConfiguration mockAdUnitConfiguration = mock(AdConfiguration.class);
BidResponse mockBidResponse = mock(BidResponse.class);
mSpyBidInterstitialView.loadAd(mockAdUnitConfiguration, mockBidResponse);
verify(mMockAdViewManager, times(1)).loadBidTransaction(eq(mockAdUnitConfiguration), eq(mockBidResponse));
}
use of org.prebid.mobile.rendering.bidding.data.bid.BidResponse in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid.
// region ======================= BidRequestListener tests
@Test
public void onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
BidRequesterListener listener = getBidRequesterListener();
listener.onFetchCompleted(mockBidResponse);
verify(mMockRewardedEventHandler, times(1)).requestAdWithBid(eq(mockBid));
assertEquals(LOADING, mRewardedAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.bidding.data.bid.BidResponse in project prebid-mobile-android by prebid.
the class BannerViewTest method onFailedAndWithWinnerBid_AdRequestStatusIsFinishedNotifyPrebidSdkWin.
@Test
public void onFailedAndWithWinnerBid_AdRequestStatusIsFinishedNotifyPrebidSdkWin() {
changePrimaryAdServerRequestStatus(true);
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
final BannerEventListener spyEventListener = spy(getBannerEventListener());
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
when(mockBidResponse.getWinningBidWidthHeightPairDips(any())).thenReturn(Pair.create(0, 0));
mBannerView.setBidResponse(mockBidResponse);
spyEventListener.onAdFailed(new AdException(AdException.INTERNAL_ERROR, "Test"));
assertFalse(mBannerView.isPrimaryAdServerRequestInProgress());
verify(spyEventListener, times(1)).onPrebidSdkWin();
}
use of org.prebid.mobile.rendering.bidding.data.bid.BidResponse in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid.
// region ======================= BidRequestListener tests
@Test
public void onFetchComplete_ChangeInterstitialStateToLoadingAndRequestAdWithBid() {
final BidResponse mockBidResponse = mock(BidResponse.class);
final Bid mockBid = mock(Bid.class);
when(mockBidResponse.getWinningBid()).thenReturn(mockBid);
BidRequesterListener listener = getBidRequesterListener();
listener.onFetchCompleted(mockBidResponse);
verify(mMockInterstitialEventHandler, times(1)).requestAdWithBid(eq(mockBid));
assertEquals(LOADING, mInterstitialAdUnit.getAdUnitState());
}
use of org.prebid.mobile.rendering.bidding.data.bid.BidResponse in project prebid-mobile-android by prebid.
the class MoPubMediationUtilsMethodsTest method setResponseToLocalExtrasInInterstitial_MoPubViewSetsResponseId.
@Test
public void setResponseToLocalExtrasInInterstitial_MoPubViewSetsResponseId() {
BidResponse bidResponse = new BidResponse(TestResponse.getResponse());
interstitialUtils.setResponseToLocalExtras(bidResponse);
HashMap<String, String> responseId = new HashMap<>();
responseId.put("PREBID_BID_RESPONSE_ID", "id");
verify(mMoPubInterstitial).setLocalExtras(responseId);
}
Aggregations