@Test public void shouldCallFailAndReturnParsedDataForProgressiveSubmitRequestWithFormErrors() throws Exception { final ProgressiveSubmitRequest request = getStubProgressiveSubmissionRequest(); final BVConversationsClient client = clientRule.getClient(); clientRule.enqueueHttp200("progressive_submission_review_submission_response_with_errors.json"); LoadCallProgressiveSubmission<ProgressiveSubmitRequest, ProgressiveSubmitResponse> loadCallProgressiveSubmission = client.prepareCall(request); loadCallProgressiveSubmission.loadAsync(new ConversationsSubmissionCallback<ProgressiveSubmitResponse>() { @Override public void onSuccess(ProgressiveSubmitResponse response) { fail(); } @Override public void onFailure(ConversationsSubmissionException exception) { assertNotNull(exception); assertNotNull(exception.getErrors()); assertNotNull(exception.getFieldErrors()); assertEquals(2, exception.getFieldErrors().size()); assertEquals("rating", exception.getFieldErrors().get(0).getField()); assertEquals("ERROR_FORM_INVALID", exception.getFieldErrors().get(0).getCode()); assertEquals(SubmissionErrorCode.ERROR_FORM_INVALID, exception.getFieldErrors().get(0).getErrorCode()); assertEquals("The rating value is out of the configured range", exception.getFieldErrors().get(0).getMessage()); assertEquals("agreedtotermsandconditions", exception.getFieldErrors().get(1).getField()); assertEquals("ERROR_FORM_REQUIRED", exception.getFieldErrors().get(1).getCode()); assertEquals(SubmissionErrorCode.ERROR_FORM_REQUIRED, exception.getFieldErrors().get(1).getErrorCode()); assertEquals("required", exception.getFieldErrors().get(1).getMessage()); } }); }
@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; }