NativeAdSource { @NonNull @Deprecated @VisibleForTesting MoPubNativeNetworkListener getMoPubNativeNetworkListener() { return mMoPubNativeNetworkListener; } NativeAdSource(); @VisibleForTesting  NativeAdSource(@NonNull final List<TimestampWrapper<NativeResponse>> nativeAdCache,
            @NonNull final Handler replenishCacheHandler);   }
@Test public void moPubNativeNetworkListener_onNativeFail_shouldResetInFlight_shouldUpdateRetryTime_shouldPostDelayedRunnable() { subject.mRequestInFlight = true; subject.mRetryTimeMilliseconds = defaultRetryTime; subject.getMoPubNativeNetworkListener().onNativeFail(NativeErrorCode.UNSPECIFIED); assertThat(subject.mRequestInFlight).isEqualTo(false); assertThat(subject.mRetryInFlight).isEqualTo(true); assertThat(subject.mRetryTimeMilliseconds).isGreaterThan(defaultRetryTime); verify(mockReplenishCacheHandler).postDelayed(any(Runnable.class), eq((long)subject.mRetryTimeMilliseconds)); }
@Test public void moPubNativeNetworkListener_onNativeFail_maxRetryTime_shouldResetInflight_shouldResetRetryTime_shouldNotPostDelayedRunnable() { subject.mRequestInFlight = true; subject.mRetryTimeMilliseconds = maxRetryTime; subject.getMoPubNativeNetworkListener().onNativeFail(NativeErrorCode.UNSPECIFIED); assertThat(subject.mRequestInFlight).isEqualTo(false); assertThat(subject.mRetryInFlight).isEqualTo(false); assertThat(subject.mRetryTimeMilliseconds).isEqualTo(defaultRetryTime); verify(mockReplenishCacheHandler, never()).postDelayed(any(Runnable.class), anyLong()); }