use of com.mopub.mediation.MoPubInterstitialMediationUtils in project prebid-mobile-android by prebid.
the class KeywordsSetupTest method handleMoPubKeywordsUpdateWithInterstitial_KeyWordsShouldMatchExpected.
@Test
public void handleMoPubKeywordsUpdateWithInterstitial_KeyWordsShouldMatchExpected() {
MoPubInterstitial moPubInterstitial = new MoPubInterstitial(mActivity, "123456");
MoPubInterstitialMediationUtils mediationUtils = new MoPubInterstitialMediationUtils(moPubInterstitial);
HashMap<String, String> bids = new HashMap<>();
bids.put("hb_pb", "0.50");
bids.put("hb_cache_id", "123456");
moPubInterstitial.setKeywords("key1:value1,key2:value2");
mediationUtils.handleKeywordsUpdate(bids);
assertEquals("hb_pb:0.50,hb_cache_id:123456,key1:value1,key2:value2", moPubInterstitial.getKeywords());
mediationUtils.handleKeywordsUpdate(null);
assertEquals("key1:value1,key2:value2", moPubInterstitial.getKeywords());
}
use of com.mopub.mediation.MoPubInterstitialMediationUtils in project prebid-mobile-android by prebid.
the class MoPubMediationUtilsMethodsTest method setup.
@Before
public void setup() {
MockitoAnnotations.openMocks(this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
mMoPubView = mock(MoPubView.class);
bannerUtils = new MoPubBannerMediationUtils(mMoPubView);
mMediationBannerAdUnit = new MediationBannerAdUnit(mContext, ID, AD_SIZE, bannerUtils);
mMoPubInterstitial = mock(MoPubInterstitial.class);
interstitialUtils = new MoPubInterstitialMediationUtils(mMoPubInterstitial);
mMediationInterstitialAdUnit = new MediationInterstitialAdUnit(mContext, ID, AD_SIZE, interstitialUtils);
mMoPubNative = mock(MoPubNative.class);
nativeUtils = new MoPubNativeMediationUtils(mMoPubNativeKeywords, mMoPubNative);
mMediationNativeAdUnit = new MediationNativeAdUnit(ID, nativeUtils);
rewardedUtils = new MoPubRewardedVideoMediationUtils(mMoPubRewardedKeywords);
mMoPubRewardedAdUnit = new MediationRewardedVideoAdUnit(mContext, ID, rewardedUtils);
}
Aggregations