    @Test
    public void receiveUploadsWhenNoCachedId() throws Exception {

        tokenRegistry.receive("mysuperspecialfcmtoken");
        verify(factory).newTokenUploadHandler(context, stack);

        ArgumentCaptor paramsCaptor = ArgumentCaptor.forClass(StringEntity.class);

        verify(client).post(
                eq(context),
                eq("https://nativepushclient-cluster1.pusher.com/client_api/v1/clients"),
                (HttpEntity) paramsCaptor.capture(),
                eq("application/json"),
                eq(tokenUploadHandler)
        );

        // test proper params sent
        HttpEntity params = (HttpEntity) paramsCaptor.getValue();
        JSONAssert.assertEquals(
                EntityUtils.toString(params),
                "{\"platform_type\":\"fcm\",\"token\":\"mysuperspecialfcmtoken\",\"app_key\":\"superkey\"}",
                true
        );
    }