@Test public void onErrorResponse_withBackoffNotApplied_shouldClearRequest() throws Exception { reset(mockRequestQueue); VolleyError volleyError = new NoConnectionError(); doThrow(new VolleyError()).when(mockScribeBackoffPolicy).backoff(volleyError); subject.onErrorResponse(volleyError); verify(mockScribeBackoffPolicy).backoff(volleyError); verify(mockRequestQueue, never()).add(mockScribeRequest); assertThat(subject.getCurrentRequest()).isNull(); }
@Override public void onErrorResponse(final VolleyError volleyError) { mHandler.post(new Runnable() { @Override public void run() { try { mBackoffPolicy.backoff(volleyError); makeRequestInternal(); } catch (VolleyError e) { MoPubLog.d("Failed to Scribe events: " + volleyError); clearRequest(); } } }); }
ScribeRequestManager extends RequestManager<ScribeRequestFactory> implements ScribeRequest.Listener { @Override public void onErrorResponse(final VolleyError volleyError) { mHandler.post(new Runnable() { @Override public void run() { try { mBackoffPolicy.backoff(volleyError); makeRequestInternal(); } catch (VolleyError e) { MoPubLog.d("Failed to Scribe events: " + volleyError); clearRequest(); } } }); } }
ScribeRequestManager extends RequestManager<ScribeRequestFactory> implements ScribeRequest.Listener { @Override public void onErrorResponse(final VolleyError volleyError) { mHandler.post(new Runnable() { @Override public void run() { try { mBackoffPolicy.backoff(volleyError); makeRequestInternal(); } catch (VolleyError e) { MoPubLog.d("Failed to Scribe events: " + volleyError); clearRequest(); } } }); } ScribeRequestManager(final Looper looper); }
ScribeRequestManager extends RequestManager<ScribeRequestFactory> implements ScribeRequest.Listener { @Override public void onErrorResponse(final VolleyError volleyError) { mHandler.post(new Runnable() { @Override public void run() { try { mBackoffPolicy.backoff(volleyError); makeRequestInternal(); } catch (VolleyError e) { MoPubLog.d("Failed to Scribe events: " + volleyError); clearRequest(); } } }); } ScribeRequestManager(final Looper looper); @Override void onResponse(); @Override void onErrorResponse(final VolleyError volleyError); }
ScribeRequestManager extends RequestManager<ScribeRequestFactory> implements ScribeRequest.Listener { @Override public void onErrorResponse(final VolleyError volleyError) { mHandler.post(new Runnable() { @Override public void run() { try { mBackoffPolicy.backoff(volleyError); makeRequestInternal(); } catch (VolleyError e) { MoPubLog.d("Failed to Scribe events: " + volleyError); clearRequest(); } } }); } ScribeRequestManager(final Looper looper); @Override void onResponse(); @Override void onErrorResponse(final VolleyError volleyError);  }