Skip to content

Commit

Permalink
feat(controls): fix tests #388
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinPostindustria committed Apr 5, 2022
1 parent fdfe4f9 commit 4c0baa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ protected Activity getActivity() {
}

protected void addCloseView() {
if (mAdViewContainer == null) {
if (mAdViewContainer == null || mInterstitialManager == null) {
LogUtil.error(TAG, "Unable to add close button. Container is null");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.prebid.mobile.rendering.models.InterstitialDisplayPropertiesInternal;
import org.prebid.mobile.rendering.video.VideoCreativeView;
import org.prebid.mobile.rendering.views.AdViewManager;
import org.prebid.mobile.rendering.views.interstitial.InterstitialManager;
Expand Down Expand Up @@ -68,6 +69,8 @@ public void handleCloseClick_DismissDialog() {

@Test
public void showBannerCreative_NullAdView() throws IllegalAccessException {
InterstitialDisplayPropertiesInternal propertiesInternal = new InterstitialDisplayPropertiesInternal();
when(mMockInterstitialManager.getInterstitialDisplayProperties()).thenReturn(propertiesInternal);
mVideoDialog.showBannerCreative(mock(View.class));
Object adView = WhiteBox.field(VideoDialog.class, "mAdView").get(mVideoDialog);
Assert.assertNull(adView);
Expand Down

0 comments on commit 4c0baa1

Please sign in to comment.