@Test public void loadAd_shouldPropagateLocationInLocalExtras() throws Exception { Location expectedLocation = new Location(""); expectedLocation.setLongitude(10.0); expectedLocation.setLongitude(20.1); when(moPubView.getLocation()).thenReturn(expectedLocation); subject = new CustomEventBannerAdapter(moPubView, CLASS_NAME, new HashMap<String, String>(), BROADCAST_IDENTIFIER, mockAdReport); subject.loadAd(); expectedLocalExtras.put("location", moPubView.getLocation()); verify(banner).loadBanner( any(Context.class), eq(subject), eq(expectedLocalExtras), eq(expectedServerExtras) ); }
void loadAd() { if (isInvalidated() || mCustomEventBanner == null) { return; } if (getTimeoutDelayMilliseconds() > 0) { mHandler.postDelayed(mTimeout, getTimeoutDelayMilliseconds()); } mCustomEventBanner.loadBanner(mContext, this, mLocalExtras, mServerExtras); }
CustomEventBannerAdapter implements CustomEventBannerListener { void loadAd() { if (isInvalidated() || mCustomEventBanner == null) { return; } if (getTimeoutDelayMilliseconds() > 0) { mHandler.postDelayed(mTimeout, getTimeoutDelayMilliseconds()); } mCustomEventBanner.loadBanner(mContext, this, mLocalExtras, mServerExtras); } }
CustomEventBannerAdapter implements CustomEventBannerListener { void loadAd() { if (isInvalidated() || mCustomEventBanner == null) { return; } if (getTimeoutDelayMilliseconds() > 0) { mHandler.postDelayed(mTimeout, getTimeoutDelayMilliseconds()); } mCustomEventBanner.loadBanner(mContext, this, mLocalExtras, mServerExtras); } CustomEventBannerAdapter(@NonNull MoPubView moPubView,
            @NonNull String className,
            @NonNull Map<String, String> serverExtras,
            long broadcastIdentifier,
            @Nullable AdReport adReport); }
CustomEventBannerAdapter implements CustomEventBannerListener { void loadAd() { if (isInvalidated() || mCustomEventBanner == null) { return; } if (getTimeoutDelayMilliseconds() > 0) { mHandler.postDelayed(mTimeout, getTimeoutDelayMilliseconds()); } mCustomEventBanner.loadBanner(mContext, this, mLocalExtras, mServerExtras); } CustomEventBannerAdapter(@NonNull MoPubView moPubView,
            @NonNull String className,
            @NonNull Map<String, String> serverExtras,
            long broadcastIdentifier,
            @Nullable AdReport adReport); @Override void onBannerLoaded(View bannerView); @Override void onBannerFailed(MoPubErrorCode errorCode); @Override void onBannerExpanded(); @Override void onBannerCollapsed(); @Override void onBannerClicked(); @Override void onLeaveApplication(); }
CustomEventBannerAdapter implements CustomEventBannerListener { void loadAd() { if (isInvalidated() || mCustomEventBanner == null) { return; } if (getTimeoutDelayMilliseconds() > 0) { mHandler.postDelayed(mTimeout, getTimeoutDelayMilliseconds()); } mCustomEventBanner.loadBanner(mContext, this, mLocalExtras, mServerExtras); } CustomEventBannerAdapter(@NonNull MoPubView moPubView,
            @NonNull String className,
            @NonNull Map<String, String> serverExtras,
            long broadcastIdentifier,
            @Nullable AdReport adReport); @Override void onBannerLoaded(View bannerView); @Override void onBannerFailed(MoPubErrorCode errorCode); @Override void onBannerExpanded(); @Override void onBannerCollapsed(); @Override void onBannerClicked(); @Override void onLeaveApplication(); static final int DEFAULT_BANNER_TIMEOUT_DELAY; }