use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class TransactionManagerTest method whenOnFailedToLoad_NotifyListener.
@Test
public void whenOnFailedToLoad_NotifyListener() {
mTransactionManager.onFailedToLoadAd(new AdException("", ""), "");
verify(mMockListener).onFetchingFailed(any(AdException.class));
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class TransactionManagerTest method whenOnTransactionFailed_CallListener.
@Test
public void whenOnTransactionFailed_CallListener() {
mTransactionManager.onTransactionFailure(new AdException("", ""), "");
verify(mMockListener).onFetchingFailed(any(AdException.class));
}
use of org.prebid.mobile.rendering.errors.AdException in project prebid-mobile-android by prebid.
the class VastParserExtractorTest method extractAndWrapperLimitReached_CallOnFailedToLoad.
@Test
public void extractAndWrapperLimitReached_CallOnFailedToLoad() throws IllegalAccessException, IOException {
String responseString = ResourceUtils.convertResourceToString("vast_wrapper_linear_nonlinear.xml");
WhiteBox.field(VastParserExtractor.class, "mVastWrapperCount").set(mVastParserExtractor, 5);
final AdException exception = new AdException(INTERNAL_ERROR, WRAPPER_LIMIT_REACH_ERROR.toString());
mVastParserExtractor.extract(responseString);
ArgumentCaptor<VastExtractorResult> argument = ArgumentCaptor.forClass(VastExtractorResult.class);
verify(mMockListener).onResult(argument.capture());
final VastExtractorResult value = argument.getValue();
assertTrue(value.hasException());
assertEquals(exception.getMessage(), value.getAdException().getMessage());
}
use of org.prebid.mobile.rendering.errors.AdException 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.errors.AdException in project prebid-mobile-android by prebid.
the class BannerViewTest method whenDisplayViewOnAdFailed_CallBannerListenerOnAdFailed.
@Test
public void whenDisplayViewOnAdFailed_CallBannerListenerOnAdFailed() throws IllegalAccessException {
getDisplayViewListener().onAdFailed(new AdException(AdException.INTERNAL_ERROR, ""));
verify(mMockBannerListener).onAdFailed(eq(mBannerView), any(AdException.class));
}
Aggregations