use of org.prebid.mobile.rendering.loading.TransactionManager in project prebid-mobile-android by prebid.
the class AdViewManagerTest method creativeInterstitialDidCloseTest.
@Test
public void creativeInterstitialDidCloseTest() throws IllegalAccessException {
AbstractCreative mockCreative = mock(AbstractCreative.class);
TransactionManager mock = mock(TransactionManager.class);
Transaction transaction = mock(Transaction.class);
when(mock.getCurrentTransaction()).thenReturn(transaction);
WhiteBox.field(AdViewManager.class, "mTransactionManager").set(mAdViewManager, mock);
mAdViewManager.creativeInterstitialDidClose(mockCreative);
verify(mMockAdViewListener).creativeInterstitialClosed();
}
use of org.prebid.mobile.rendering.loading.TransactionManager in project prebid-mobile-android by prebid.
the class AdViewManagerTest method whenInterstitialHtmlNotResolved_Return.
@Test
public void whenInterstitialHtmlNotResolved_Return() throws IllegalAccessException {
AbstractCreative mockCreative = mock(AbstractCreative.class);
when(mockCreative.isDisplay()).thenReturn(true);
when(mockCreative.isResolved()).thenReturn(false);
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(mAdViewManager, mockCreative);
TransactionManager mockTransactionManager = mock(TransactionManager.class);
when(mockTransactionManager.getCurrentCreative()).thenReturn(mockCreative);
WhiteBox.field(AdViewManager.class, "mTransactionManager").set(mAdViewManager, mockTransactionManager);
ArgumentCaptor exceptionCaptor = ArgumentCaptor.forClass(AdException.class);
mAdViewManager.show();
verify(mMockAdViewListener, never()).viewReadyForImmediateDisplay(any(View.class));
verify(mMockAdViewListener).failedToLoad((AdException) exceptionCaptor.capture());
assertEquals("SDK internal error: Creative has not been resolved yet", ((AdException) exceptionCaptor.getValue()).getMessage());
}
use of org.prebid.mobile.rendering.loading.TransactionManager in project prebid-mobile-android by prebid.
the class AdViewManagerTest method destroy_Cleanup.
@Test
public void destroy_Cleanup() throws IllegalAccessException {
setupCreative();
TransactionManager mockTransactionManager = mock(TransactionManager.class);
WhiteBox.field(AdViewManager.class, "mTransactionManager").set(mAdViewManager, mockTransactionManager);
mAdViewManager.destroy();
verify(mockTransactionManager).destroy();
verify(mMockVideoCreative).destroy();
}
Aggregations