@Test public void onAdLoadError_withErrorReasonWarmingUp_shouldReturnErrorCodeWarmup_shouldCallMoPubViewAdFailed() { final VolleyError expectedInternalError = new MoPubNetworkError( MoPubNetworkError.Reason.WARMING_UP); subject.onAdLoadError(expectedInternalError); verify(mockMoPubView).adFailed(MoPubErrorCode.WARMUP); }
@VisibleForTesting void onAdLoadError(final VolleyError error) { if (error instanceof MoPubNetworkError) { final MoPubNetworkError moPubNetworkError = (MoPubNetworkError) error; if (moPubNetworkError.getRefreshTimeMillis() != null) { mRefreshTimeMillis = moPubNetworkError.getRefreshTimeMillis(); } } final MoPubErrorCode errorCode = getErrorCodeFromVolleyError(error, mContext); if (errorCode == MoPubErrorCode.SERVER_ERROR) { mBackoffPower++; } setNotLoading(); adDidFail(errorCode); }
AdViewController { @VisibleForTesting void onAdLoadError(final VolleyError error) { if (error instanceof MoPubNetworkError) { final MoPubNetworkError moPubNetworkError = (MoPubNetworkError) error; if (moPubNetworkError.getRefreshTimeMillis() != null) { mRefreshTimeMillis = moPubNetworkError.getRefreshTimeMillis(); } } final MoPubErrorCode errorCode = getErrorCodeFromVolleyError(error, mContext); if (errorCode == MoPubErrorCode.SERVER_ERROR) { mBackoffPower++; } setNotLoading(); adDidFail(errorCode); } }
AdViewController { @VisibleForTesting void onAdLoadError(final VolleyError error) { if (error instanceof MoPubNetworkError) { final MoPubNetworkError moPubNetworkError = (MoPubNetworkError) error; if (moPubNetworkError.getRefreshTimeMillis() != null) { mRefreshTimeMillis = moPubNetworkError.getRefreshTimeMillis(); } } final MoPubErrorCode errorCode = getErrorCodeFromVolleyError(error, mContext); if (errorCode == MoPubErrorCode.SERVER_ERROR) { mBackoffPower++; } setNotLoading(); adDidFail(errorCode); } AdViewController(@NonNull Context context, @NonNull MoPubView view); }
AdViewController { @VisibleForTesting void onAdLoadError(final VolleyError error) { if (error instanceof MoPubNetworkError) { final MoPubNetworkError moPubNetworkError = (MoPubNetworkError) error; if (moPubNetworkError.getRefreshTimeMillis() != null) { mRefreshTimeMillis = moPubNetworkError.getRefreshTimeMillis(); } } final MoPubErrorCode errorCode = getErrorCodeFromVolleyError(error, mContext); if (errorCode == MoPubErrorCode.SERVER_ERROR) { mBackoffPower++; } setNotLoading(); adDidFail(errorCode); } AdViewController(@NonNull Context context, @NonNull MoPubView view); static void setShouldHonorServerDimensions(View view); @Nullable MoPubView getMoPubView(); void loadAd(); void reload(); String getKeywords(); void setKeywords(String keywords); Location getLocation(); void setLocation(Location location); String getAdUnitId(); void setAdUnitId(@NonNull String adUnitId); long getBroadcastIdentifier(); void setTimeout(int milliseconds); int getAdWidth(); int getAdHeight(); @Deprecated String getClickTrackingUrl(); @Deprecated String getRedirectUrl(); @Deprecated String getResponseString(); boolean getAutorefreshEnabled(); @Nullable AdReport getAdReport(); boolean getTesting(); void setTesting(boolean enabled); @Deprecated void customEventDidLoadAd(); @Deprecated void customEventDidFailToLoadAd(); @Deprecated void customEventActionWillBegin(); @Deprecated void setClickthroughUrl(String clickthroughUrl); @Deprecated boolean isFacebookSupported(); @Deprecated void setFacebookSupported(boolean enabled); }
AdViewController { @VisibleForTesting void onAdLoadError(final VolleyError error) { if (error instanceof MoPubNetworkError) { final MoPubNetworkError moPubNetworkError = (MoPubNetworkError) error; if (moPubNetworkError.getRefreshTimeMillis() != null) { mRefreshTimeMillis = moPubNetworkError.getRefreshTimeMillis(); } } final MoPubErrorCode errorCode = getErrorCodeFromVolleyError(error, mContext); if (errorCode == MoPubErrorCode.SERVER_ERROR) { mBackoffPower++; } setNotLoading(); adDidFail(errorCode); } AdViewController(@NonNull Context context, @NonNull MoPubView view); static void setShouldHonorServerDimensions(View view); @Nullable MoPubView getMoPubView(); void loadAd(); void reload(); String getKeywords(); void setKeywords(String keywords); Location getLocation(); void setLocation(Location location); String getAdUnitId(); void setAdUnitId(@NonNull String adUnitId); long getBroadcastIdentifier(); void setTimeout(int milliseconds); int getAdWidth(); int getAdHeight(); @Deprecated String getClickTrackingUrl(); @Deprecated String getRedirectUrl(); @Deprecated String getResponseString(); boolean getAutorefreshEnabled(); @Nullable AdReport getAdReport(); boolean getTesting(); void setTesting(boolean enabled); @Deprecated void customEventDidLoadAd(); @Deprecated void customEventDidFailToLoadAd(); @Deprecated void customEventActionWillBegin(); @Deprecated void setClickthroughUrl(String clickthroughUrl); @Deprecated boolean isFacebookSupported(); @Deprecated void setFacebookSupported(boolean enabled);  }