use of org.prebid.mobile.rendering.views.interstitial.InterstitialManager in project prebid-mobile-android by prebid.
the class AdExpandedDialogTest method handleCloseClick.
@Test
public void handleCloseClick() throws IllegalAccessException {
InterstitialManager interstitialManager = mock(InterstitialManager.class);
Field interstitialManagerField = WhiteBox.field(AdInterstitialDialog.class, "mInterstitialManager");
interstitialManagerField.set(mAdExpandedDialog, interstitialManager);
mAdExpandedDialog.handleCloseClick();
verify(interstitialManager).interstitialClosed(eq(mMockWebViewBase));
}
use of org.prebid.mobile.rendering.views.interstitial.InterstitialManager in project prebid-mobile-android by prebid.
the class TransactionTest method onSuccessWithCreativeTimeout_TransactionListenerSuccessNotCalled.
@Test
public void onSuccessWithCreativeTimeout_TransactionListenerSuccessNotCalled() throws Exception {
List<CreativeModel> creativeModels = Arrays.asList(mock(CreativeModel.class), mock(CreativeModel.class));
Transaction.Listener mockListener = mock(Transaction.Listener.class);
InterstitialManager mockInterstitialManager = mock(InterstitialManager.class);
Transaction transaction = Transaction.createTransaction(mMockContext, createModelResult(creativeModels, ""), mockInterstitialManager, mockListener);
Transaction.CreativeFactoryListener creativeFactoryListener = new Transaction.CreativeFactoryListener(transaction);
Iterator<CreativeFactory> mockIterator = mock(Iterator.class);
when(mockIterator.hasNext()).thenReturn(true);
when(mockIterator.next()).thenReturn(mock(CreativeFactory.class));
WhiteBox.setInternalState(transaction, "mCreativeFactoryIterator", mockIterator);
creativeFactoryListener.onSuccess();
verify(mockListener, never()).onTransactionSuccess(transaction);
AdException adException = new AdException(AdException.INTERNAL_ERROR, "CreativeFactory Timeout");
creativeFactoryListener.onFailure(adException);
verify(mockListener).onTransactionFailure(eq(adException), anyString());
}
Aggregations