TokenUpdateHandler extends AsyncHttpResponseHandler { @Override public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { Log.d(TAG, "Registration token updated"); this.listenerStack.onSuccessfulRegistration(cachedId, context); } TokenUpdateHandler(String cachedId, StringEntity retryParams, Context context, RegistrationListenerStack listenerStack, InvalidClientIdHandler invalidClientIdHandler); @Override void onSuccess(int statusCode, Header[] headers, byte[] responseBody); @Override void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error);  }
@Test public void testListenerStackSuccessOnSuccess(){ tokenUpdateHandler.onSuccess(200, null, null); verify(listenerStack).onSuccessfulRegistration("cached-id", context); }