@Test public void shouldCallSuccessAndReturnParsedDataForInitiateSubmitRequest() throws Exception { final InitiateSubmitRequest request = getStubInitiateProgressiveSessionFormRequest(); final BVConversationsClient client = clientRule.getClient(); clientRule.enqueueHttp200("progressive_submission_initiate_submit_response.json"); LoadCallProgressiveSubmission loadCallProgressiveSubmission = client.prepareCall(request); loadCallProgressiveSubmission.loadAsync(new ConversationsSubmissionCallback<InitiateSubmitResponse>() { @Override public void onSuccess(InitiateSubmitResponse response) { assertNotNull(response); assertFalse(response.getHasErrors()); assertNotNull(response.getData()); assertNotNull(response.getData().getProductFormData()); assertNotNull(response.getData().getProductFormData().get("product4").getSubmissionSessionToken()); Review review = response.getData().getProductFormData().get("product4").getReview(); assertNotNull(review); assertEquals("product4", review.getProductId()); assertEquals("123456789020abc", review.getSubmissionId()); assertTrue(response.getData().getProductFormData().containsKey("product4")); Map<String, FormField> fields = response.getData().getProductFormData().get("product4").getFields(); assertEquals(FormInputType.TEXT, fields.get("FreeTextQuestion").getFormInputType()); assertEquals(FormInputType.CHOICE, fields.get("UsageFrequency1").getFormInputType()); assertEquals(FormInputType.URL, fields.get("photourl_1").getFormInputType()); assertEquals(FormInputType.BOOLEAN, fields.get("isrecommended").getFormInputType()); assertEquals(FormInputType.INTEGER, fields.get("Slider").getFormInputType()); assertEquals(response.getData().getProductFormData().get("product4").getFormFields().size(), 27); } @Override public void onFailure(@NonNull ConversationsSubmissionException exception) { fail(); } }); }
@Override @Deprecated public void loadAsync(ConversationsCallback<ResponseType> conversationsCallback) { BVSDK.getInstance().bvLogger.v(TAG, "Beginning of async request"); checkMain(); this.conversationsCallback = conversationsCallback; displayWorkerHandler.sendEmptyMessage(0); }
LoadCallProgressiveSubmission extends LoadCall<RequestType, ResponseType> { @Override @Deprecated public void loadAsync(ConversationsCallback<ResponseType> conversationsCallback) { BVSDK.getInstance().bvLogger.v(TAG, "Beginning of async request"); checkMain(); this.conversationsCallback = conversationsCallback; displayWorkerHandler.sendEmptyMessage(0); } }
LoadCallProgressiveSubmission extends LoadCall<RequestType, ResponseType> { @Override @Deprecated public void loadAsync(ConversationsCallback<ResponseType> conversationsCallback) { BVSDK.getInstance().bvLogger.v(TAG, "Beginning of async request"); checkMain(); this.conversationsCallback = conversationsCallback; displayWorkerHandler.sendEmptyMessage(0); } LoadCallProgressiveSubmission(
            RequestType request,
            Class<ResponseType> responseTypeClass,
            ConversationsAnalyticsManager conversationsAnalyticsManager,
            Looper uiLooper,
            Looper bgLooper,
            OkHttpClient okHttpClient,
            Gson gson,
            Call call); }
LoadCallProgressiveSubmission extends LoadCall<RequestType, ResponseType> { @Override @Deprecated public void loadAsync(ConversationsCallback<ResponseType> conversationsCallback) { BVSDK.getInstance().bvLogger.v(TAG, "Beginning of async request"); checkMain(); this.conversationsCallback = conversationsCallback; displayWorkerHandler.sendEmptyMessage(0); } LoadCallProgressiveSubmission(
            RequestType request,
            Class<ResponseType> responseTypeClass,
            ConversationsAnalyticsManager conversationsAnalyticsManager,
            Looper uiLooper,
            Looper bgLooper,
            OkHttpClient okHttpClient,
            Gson gson,
            Call call); @Override @WorkerThread ResponseType loadSync(); @Override @Deprecated /** * @deprecated Use {@link #loadAsync(ConversationsSubmissionCallback)} instead */ void loadAsync(ConversationsCallback<ResponseType> conversationsCallback); @MainThread void loadAsync(@NonNull ConversationsSubmissionCallback<ResponseType> conversationsCallback); }
LoadCallProgressiveSubmission extends LoadCall<RequestType, ResponseType> { @Override @Deprecated public void loadAsync(ConversationsCallback<ResponseType> conversationsCallback) { BVSDK.getInstance().bvLogger.v(TAG, "Beginning of async request"); checkMain(); this.conversationsCallback = conversationsCallback; displayWorkerHandler.sendEmptyMessage(0); } LoadCallProgressiveSubmission(
            RequestType request,
            Class<ResponseType> responseTypeClass,
            ConversationsAnalyticsManager conversationsAnalyticsManager,
            Looper uiLooper,
            Looper bgLooper,
            OkHttpClient okHttpClient,
            Gson gson,
            Call call); @Override @WorkerThread ResponseType loadSync(); @Override @Deprecated /** * @deprecated Use {@link #loadAsync(ConversationsSubmissionCallback)} instead */ void loadAsync(ConversationsCallback<ResponseType> conversationsCallback); @MainThread void loadAsync(@NonNull ConversationsSubmissionCallback<ResponseType> conversationsCallback); static final String TAG; }