@Test public void submissionShouldNotAllowNullFormParams() throws Exception { final ReviewSubmissionRequest request = new ReviewSubmissionRequest.Builder(Action.Preview, "prod1") .isRecommended(null) .build(); final Request okRequest = requestFactory.create(request); requestFactoryUtils.assertFormBodyContainsKeyEncoded(okRequest, "IsRecommended", false); }
public <RequestType extends ConversationsRequest> Request create(RequestType request) { if (request instanceof ReviewsRequest) { return createFromReviewRequest((ReviewsRequest) request); } else if (request instanceof QuestionAndAnswerRequest) { return createFromQuestionAndAnswerRequest((QuestionAndAnswerRequest) request); }else if (request instanceof ReviewHighlightsRequest) { return createFromReviewHighlightsRequest((ReviewHighlightsRequest) request); } else if (request instanceof CommentsRequest) { return createFromCommentsRequest((CommentsRequest) request); } else if (request instanceof AuthorsRequest) { return createFromAuthorsRequest((AuthorsRequest) request); } else if (request instanceof BulkStoreRequest) { return createFromBulkStoreRequest((BulkStoreRequest) request); } else if (request instanceof BulkRatingsRequest) { return createFromBulkRatingsRequest((BulkRatingsRequest) request); } else if (request instanceof StoreReviewsRequest) { return createFromStoreReviewsRequest((StoreReviewsRequest) request); } else if (request instanceof BulkProductRequest) { return createFromBulkProductRequest((BulkProductRequest) request); } else if (request instanceof ProductDisplayPageRequest) { return createFromProductDisplayPageRequest((ProductDisplayPageRequest) request); } else if (request instanceof FeedbackSubmissionRequest) { return createFromFeedbackSubmissionRequest((FeedbackSubmissionRequest) request); } else if (request instanceof ReviewSubmissionRequest) { return createFromReviewSubmissionRequest((ReviewSubmissionRequest) request); } else if (request instanceof StoreReviewSubmissionRequest) { return createFromStoreReviewSubmissionRequest((StoreReviewSubmissionRequest) request); } else if (request instanceof QuestionSubmissionRequest) { return createFromQuestionSubmissionRequest((QuestionSubmissionRequest) request); } else if (request instanceof AnswerSubmissionRequest) { return createFromAnswerSubmissionRequest((AnswerSubmissionRequest) request); } else if (request instanceof CommentSubmissionRequest) { return createFromCommentSubmissionRequest((CommentSubmissionRequest) request); } else if (request instanceof PhotoUploadRequest) { return createFromPhotoUploadRequest((PhotoUploadRequest) request); } else if (request instanceof UserAuthenticationStringRequest) { return createFromUserAuthenticationStringRequest((UserAuthenticationStringRequest) request); } else if (request instanceof InitiateSubmitRequest) { return createFromInitiateSubmitRequest((InitiateSubmitRequest) request); } else if(request instanceof ProgressiveSubmitRequest) { return createFromProgressiveSubmitRequest((ProgressiveSubmitRequest) request); } throw new IllegalStateException("Unknown request type: " + request.getClass().getCanonicalName()); }
BasicRequestFactory implements RequestFactory { public <RequestType extends ConversationsRequest> Request create(RequestType request) { if (request instanceof ReviewsRequest) { return createFromReviewRequest((ReviewsRequest) request); } else if (request instanceof QuestionAndAnswerRequest) { return createFromQuestionAndAnswerRequest((QuestionAndAnswerRequest) request); }else if (request instanceof ReviewHighlightsRequest) { return createFromReviewHighlightsRequest((ReviewHighlightsRequest) request); } else if (request instanceof CommentsRequest) { return createFromCommentsRequest((CommentsRequest) request); } else if (request instanceof AuthorsRequest) { return createFromAuthorsRequest((AuthorsRequest) request); } else if (request instanceof BulkStoreRequest) { return createFromBulkStoreRequest((BulkStoreRequest) request); } else if (request instanceof BulkRatingsRequest) { return createFromBulkRatingsRequest((BulkRatingsRequest) request); } else if (request instanceof StoreReviewsRequest) { return createFromStoreReviewsRequest((StoreReviewsRequest) request); } else if (request instanceof BulkProductRequest) { return createFromBulkProductRequest((BulkProductRequest) request); } else if (request instanceof ProductDisplayPageRequest) { return createFromProductDisplayPageRequest((ProductDisplayPageRequest) request); } else if (request instanceof FeedbackSubmissionRequest) { return createFromFeedbackSubmissionRequest((FeedbackSubmissionRequest) request); } else if (request instanceof ReviewSubmissionRequest) { return createFromReviewSubmissionRequest((ReviewSubmissionRequest) request); } else if (request instanceof StoreReviewSubmissionRequest) { return createFromStoreReviewSubmissionRequest((StoreReviewSubmissionRequest) request); } else if (request instanceof QuestionSubmissionRequest) { return createFromQuestionSubmissionRequest((QuestionSubmissionRequest) request); } else if (request instanceof AnswerSubmissionRequest) { return createFromAnswerSubmissionRequest((AnswerSubmissionRequest) request); } else if (request instanceof CommentSubmissionRequest) { return createFromCommentSubmissionRequest((CommentSubmissionRequest) request); } else if (request instanceof PhotoUploadRequest) { return createFromPhotoUploadRequest((PhotoUploadRequest) request); } else if (request instanceof UserAuthenticationStringRequest) { return createFromUserAuthenticationStringRequest((UserAuthenticationStringRequest) request); } else if (request instanceof InitiateSubmitRequest) { return createFromInitiateSubmitRequest((InitiateSubmitRequest) request); } else if(request instanceof ProgressiveSubmitRequest) { return createFromProgressiveSubmitRequest((ProgressiveSubmitRequest) request); } throw new IllegalStateException("Unknown request type: " + request.getClass().getCanonicalName()); } }
BasicRequestFactory implements RequestFactory { public <RequestType extends ConversationsRequest> Request create(RequestType request) { if (request instanceof ReviewsRequest) { return createFromReviewRequest((ReviewsRequest) request); } else if (request instanceof QuestionAndAnswerRequest) { return createFromQuestionAndAnswerRequest((QuestionAndAnswerRequest) request); }else if (request instanceof ReviewHighlightsRequest) { return createFromReviewHighlightsRequest((ReviewHighlightsRequest) request); } else if (request instanceof CommentsRequest) { return createFromCommentsRequest((CommentsRequest) request); } else if (request instanceof AuthorsRequest) { return createFromAuthorsRequest((AuthorsRequest) request); } else if (request instanceof BulkStoreRequest) { return createFromBulkStoreRequest((BulkStoreRequest) request); } else if (request instanceof BulkRatingsRequest) { return createFromBulkRatingsRequest((BulkRatingsRequest) request); } else if (request instanceof StoreReviewsRequest) { return createFromStoreReviewsRequest((StoreReviewsRequest) request); } else if (request instanceof BulkProductRequest) { return createFromBulkProductRequest((BulkProductRequest) request); } else if (request instanceof ProductDisplayPageRequest) { return createFromProductDisplayPageRequest((ProductDisplayPageRequest) request); } else if (request instanceof FeedbackSubmissionRequest) { return createFromFeedbackSubmissionRequest((FeedbackSubmissionRequest) request); } else if (request instanceof ReviewSubmissionRequest) { return createFromReviewSubmissionRequest((ReviewSubmissionRequest) request); } else if (request instanceof StoreReviewSubmissionRequest) { return createFromStoreReviewSubmissionRequest((StoreReviewSubmissionRequest) request); } else if (request instanceof QuestionSubmissionRequest) { return createFromQuestionSubmissionRequest((QuestionSubmissionRequest) request); } else if (request instanceof AnswerSubmissionRequest) { return createFromAnswerSubmissionRequest((AnswerSubmissionRequest) request); } else if (request instanceof CommentSubmissionRequest) { return createFromCommentSubmissionRequest((CommentSubmissionRequest) request); } else if (request instanceof PhotoUploadRequest) { return createFromPhotoUploadRequest((PhotoUploadRequest) request); } else if (request instanceof UserAuthenticationStringRequest) { return createFromUserAuthenticationStringRequest((UserAuthenticationStringRequest) request); } else if (request instanceof InitiateSubmitRequest) { return createFromInitiateSubmitRequest((InitiateSubmitRequest) request); } else if(request instanceof ProgressiveSubmitRequest) { return createFromProgressiveSubmitRequest((ProgressiveSubmitRequest) request); } throw new IllegalStateException("Unknown request type: " + request.getClass().getCanonicalName()); } BasicRequestFactory(BVMobileInfo bvMobileInfo, BVRootApiUrls bvRootApiUrls, BVConfig bvConfig, String bvSdkUserAgent, FingerprintProvider fingerprintProvider); }
BasicRequestFactory implements RequestFactory { public <RequestType extends ConversationsRequest> Request create(RequestType request) { if (request instanceof ReviewsRequest) { return createFromReviewRequest((ReviewsRequest) request); } else if (request instanceof QuestionAndAnswerRequest) { return createFromQuestionAndAnswerRequest((QuestionAndAnswerRequest) request); }else if (request instanceof ReviewHighlightsRequest) { return createFromReviewHighlightsRequest((ReviewHighlightsRequest) request); } else if (request instanceof CommentsRequest) { return createFromCommentsRequest((CommentsRequest) request); } else if (request instanceof AuthorsRequest) { return createFromAuthorsRequest((AuthorsRequest) request); } else if (request instanceof BulkStoreRequest) { return createFromBulkStoreRequest((BulkStoreRequest) request); } else if (request instanceof BulkRatingsRequest) { return createFromBulkRatingsRequest((BulkRatingsRequest) request); } else if (request instanceof StoreReviewsRequest) { return createFromStoreReviewsRequest((StoreReviewsRequest) request); } else if (request instanceof BulkProductRequest) { return createFromBulkProductRequest((BulkProductRequest) request); } else if (request instanceof ProductDisplayPageRequest) { return createFromProductDisplayPageRequest((ProductDisplayPageRequest) request); } else if (request instanceof FeedbackSubmissionRequest) { return createFromFeedbackSubmissionRequest((FeedbackSubmissionRequest) request); } else if (request instanceof ReviewSubmissionRequest) { return createFromReviewSubmissionRequest((ReviewSubmissionRequest) request); } else if (request instanceof StoreReviewSubmissionRequest) { return createFromStoreReviewSubmissionRequest((StoreReviewSubmissionRequest) request); } else if (request instanceof QuestionSubmissionRequest) { return createFromQuestionSubmissionRequest((QuestionSubmissionRequest) request); } else if (request instanceof AnswerSubmissionRequest) { return createFromAnswerSubmissionRequest((AnswerSubmissionRequest) request); } else if (request instanceof CommentSubmissionRequest) { return createFromCommentSubmissionRequest((CommentSubmissionRequest) request); } else if (request instanceof PhotoUploadRequest) { return createFromPhotoUploadRequest((PhotoUploadRequest) request); } else if (request instanceof UserAuthenticationStringRequest) { return createFromUserAuthenticationStringRequest((UserAuthenticationStringRequest) request); } else if (request instanceof InitiateSubmitRequest) { return createFromInitiateSubmitRequest((InitiateSubmitRequest) request); } else if(request instanceof ProgressiveSubmitRequest) { return createFromProgressiveSubmitRequest((ProgressiveSubmitRequest) request); } throw new IllegalStateException("Unknown request type: " + request.getClass().getCanonicalName()); } BasicRequestFactory(BVMobileInfo bvMobileInfo, BVRootApiUrls bvRootApiUrls, BVConfig bvConfig, String bvSdkUserAgent, FingerprintProvider fingerprintProvider); Request create(RequestType request); }
BasicRequestFactory implements RequestFactory { public <RequestType extends ConversationsRequest> Request create(RequestType request) { if (request instanceof ReviewsRequest) { return createFromReviewRequest((ReviewsRequest) request); } else if (request instanceof QuestionAndAnswerRequest) { return createFromQuestionAndAnswerRequest((QuestionAndAnswerRequest) request); }else if (request instanceof ReviewHighlightsRequest) { return createFromReviewHighlightsRequest((ReviewHighlightsRequest) request); } else if (request instanceof CommentsRequest) { return createFromCommentsRequest((CommentsRequest) request); } else if (request instanceof AuthorsRequest) { return createFromAuthorsRequest((AuthorsRequest) request); } else if (request instanceof BulkStoreRequest) { return createFromBulkStoreRequest((BulkStoreRequest) request); } else if (request instanceof BulkRatingsRequest) { return createFromBulkRatingsRequest((BulkRatingsRequest) request); } else if (request instanceof StoreReviewsRequest) { return createFromStoreReviewsRequest((StoreReviewsRequest) request); } else if (request instanceof BulkProductRequest) { return createFromBulkProductRequest((BulkProductRequest) request); } else if (request instanceof ProductDisplayPageRequest) { return createFromProductDisplayPageRequest((ProductDisplayPageRequest) request); } else if (request instanceof FeedbackSubmissionRequest) { return createFromFeedbackSubmissionRequest((FeedbackSubmissionRequest) request); } else if (request instanceof ReviewSubmissionRequest) { return createFromReviewSubmissionRequest((ReviewSubmissionRequest) request); } else if (request instanceof StoreReviewSubmissionRequest) { return createFromStoreReviewSubmissionRequest((StoreReviewSubmissionRequest) request); } else if (request instanceof QuestionSubmissionRequest) { return createFromQuestionSubmissionRequest((QuestionSubmissionRequest) request); } else if (request instanceof AnswerSubmissionRequest) { return createFromAnswerSubmissionRequest((AnswerSubmissionRequest) request); } else if (request instanceof CommentSubmissionRequest) { return createFromCommentSubmissionRequest((CommentSubmissionRequest) request); } else if (request instanceof PhotoUploadRequest) { return createFromPhotoUploadRequest((PhotoUploadRequest) request); } else if (request instanceof UserAuthenticationStringRequest) { return createFromUserAuthenticationStringRequest((UserAuthenticationStringRequest) request); } else if (request instanceof InitiateSubmitRequest) { return createFromInitiateSubmitRequest((InitiateSubmitRequest) request); } else if(request instanceof ProgressiveSubmitRequest) { return createFromProgressiveSubmitRequest((ProgressiveSubmitRequest) request); } throw new IllegalStateException("Unknown request type: " + request.getClass().getCanonicalName()); } BasicRequestFactory(BVMobileInfo bvMobileInfo, BVRootApiUrls bvRootApiUrls, BVConfig bvConfig, String bvSdkUserAgent, FingerprintProvider fingerprintProvider); Request create(RequestType request); static final String kDEVICE_FINGERPRINT; static final String kEMAIL_USER; }