use of com.mopub.mediation.MoPubRewardedVideoMediationUtils 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);
}
use of com.mopub.mediation.MoPubRewardedVideoMediationUtils in project prebid-mobile-android by prebid.
the class MoPubMediationUtilsWithAdUnitsTest method whenOnResponseReceived_UpdateHashMapAndBidCache.
@Test
public void whenOnResponseReceived_UpdateHashMapAndBidCache() {
String responseString = TestResponse.getResponse();
HashMap<String, String> keywordsMap = TestResponse.getKeywordsMap();
BidResponse bidResponse = new BidResponse(responseString);
OnFetchCompleteListener mockListener = mock(OnFetchCompleteListener.class);
MoPubRewardedVideoMediationUtils mediationUtils = mock(MoPubRewardedVideoMediationUtils.class);
OpenMediationRewardedVideoAdUnit adUnit = new OpenMediationRewardedVideoAdUnit(context, "mopub", mediationUtils);
WhiteBox.setInternalState(adUnit, "mBidLoader", mMockBidLoader);
adUnit.fetchDemand(mockListener);
adUnit.onResponse(bidResponse);
verify(mockListener).onComplete(FetchDemandResult.SUCCESS);
verify(mediationUtils).handleKeywordsUpdate(keywordsMap);
}
Aggregations