TokenRegistry implements InvalidClientIdHandler, InternalRegistrationProgressListener { @Override public void onInvalidClientId(StringEntity params) { upload(params); } TokenRegistry(String appKey, RegistrationListenerStack listenerStack, Context context, PlatformType platformType, PusherAndroidOptions options, PusherAndroidFactory factory); void receive(String token); @Override void onInvalidClientId(StringEntity params); @Override void onSuccessfulRegistration(String clientId, Context context); @Override void onFailedRegistration(int statusCode, String reason);  }
@Test public void uploadsOnInvalidClientId() throws Exception { JSONObject json = new JSONObject(); json.put("platform_type", PlatformType.GCM.toString()); json.put("token", "token-woot"); json.put("app_key", "app-key-lala"); StringEntity params = new StringEntity(json.toString(), "UTF-8"); tokenRegistry.onInvalidClientId(params); verify(client).post( eq(context), eq("https: eq(params), eq("application/json"), eq(tokenUploadHandler) ); }