@Test(expected = RequestException.class) public void testNullUrlDisassociate() throws RequestException { runtimeConfig.setUrlConfig(AirshipUrlConfig.newBuilder().build()); client.disassociate(fakeChannelId); }
@NonNull Response<Void> disassociate(@NonNull String channelId) throws RequestException { URL url = runtimeConfig.getUrlConfig() .deviceUrl() .appendEncodedPath(DISASSOCIATE_PATH) .build(); JsonMap payload = JsonMap.newBuilder() .put(CHANNEL_KEY, channelId) .put(DEVICE_TYPE_KEY, getDeviceType()) .build(); return requestFactory.createRequest() .setOperation("POST", url) .setCredentials(runtimeConfig.getConfigOptions().appKey, runtimeConfig.getConfigOptions().appSecret) .setRequestBody(payload) .setAirshipJsonAcceptsHeader() .execute(); }
NamedUserApiClient { @NonNull Response<Void> disassociate(@NonNull String channelId) throws RequestException { URL url = runtimeConfig.getUrlConfig() .deviceUrl() .appendEncodedPath(DISASSOCIATE_PATH) .build(); JsonMap payload = JsonMap.newBuilder() .put(CHANNEL_KEY, channelId) .put(DEVICE_TYPE_KEY, getDeviceType()) .build(); return requestFactory.createRequest() .setOperation("POST", url) .setCredentials(runtimeConfig.getConfigOptions().appKey, runtimeConfig.getConfigOptions().appSecret) .setRequestBody(payload) .setAirshipJsonAcceptsHeader() .execute(); } }
NamedUserApiClient { @NonNull Response<Void> disassociate(@NonNull String channelId) throws RequestException { URL url = runtimeConfig.getUrlConfig() .deviceUrl() .appendEncodedPath(DISASSOCIATE_PATH) .build(); JsonMap payload = JsonMap.newBuilder() .put(CHANNEL_KEY, channelId) .put(DEVICE_TYPE_KEY, getDeviceType()) .build(); return requestFactory.createRequest() .setOperation("POST", url) .setCredentials(runtimeConfig.getConfigOptions().appKey, runtimeConfig.getConfigOptions().appSecret) .setRequestBody(payload) .setAirshipJsonAcceptsHeader() .execute(); } NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig); @VisibleForTesting  NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig, @NonNull RequestFactory requestFactory); }
NamedUserApiClient { @NonNull Response<Void> disassociate(@NonNull String channelId) throws RequestException { URL url = runtimeConfig.getUrlConfig() .deviceUrl() .appendEncodedPath(DISASSOCIATE_PATH) .build(); JsonMap payload = JsonMap.newBuilder() .put(CHANNEL_KEY, channelId) .put(DEVICE_TYPE_KEY, getDeviceType()) .build(); return requestFactory.createRequest() .setOperation("POST", url) .setCredentials(runtimeConfig.getConfigOptions().appKey, runtimeConfig.getConfigOptions().appSecret) .setRequestBody(payload) .setAirshipJsonAcceptsHeader() .execute(); } NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig); @VisibleForTesting  NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig, @NonNull RequestFactory requestFactory);  }
NamedUserApiClient { @NonNull Response<Void> disassociate(@NonNull String channelId) throws RequestException { URL url = runtimeConfig.getUrlConfig() .deviceUrl() .appendEncodedPath(DISASSOCIATE_PATH) .build(); JsonMap payload = JsonMap.newBuilder() .put(CHANNEL_KEY, channelId) .put(DEVICE_TYPE_KEY, getDeviceType()) .build(); return requestFactory.createRequest() .setOperation("POST", url) .setCredentials(runtimeConfig.getConfigOptions().appKey, runtimeConfig.getConfigOptions().appSecret) .setRequestBody(payload) .setAirshipJsonAcceptsHeader() .execute(); } NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig); @VisibleForTesting  NamedUserApiClient(@NonNull AirshipRuntimeConfig runtimeConfig, @NonNull RequestFactory requestFactory);   }