CompareComply extends BaseService { public ServiceCall<FeedbackReturn> addFeedback(AddFeedbackOptions addFeedbackOptions) { com.ibm.cloud.sdk.core.util.Validator.notNull( addFeedbackOptions, "addFeedbackOptions cannot be null"); String[] pathSegments = {"v1/feedback"}; RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getServiceUrl(), pathSegments)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("compare-comply", "v1", "addFeedback"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); final JsonObject contentJson = new JsonObject(); contentJson.add( "feedback_data", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() .toJsonTree(addFeedbackOptions.feedbackData())); if (addFeedbackOptions.userId() != null) { contentJson.addProperty("user_id", addFeedbackOptions.userId()); } if (addFeedbackOptions.comment() != null) { contentJson.addProperty("comment", addFeedbackOptions.comment()); } builder.bodyJson(contentJson); ResponseConverter<FeedbackReturn> responseConverter = ResponseConverterUtils.getValue( new com.google.gson.reflect.TypeToken<FeedbackReturn>() {}.getType()); return createServiceCall(builder.build(), responseConverter); } CompareComply(String versionDate);  CompareComply(String versionDate, Authenticator authenticator);  CompareComply(String versionDate, String serviceName);  CompareComply(String versionDate, String serviceName, Authenticator authenticator); ServiceCall<HTMLReturn> convertToHtml(ConvertToHtmlOptions convertToHtmlOptions); ServiceCall<ClassifyReturn> classifyElements(
      ClassifyElementsOptions classifyElementsOptions); ServiceCall<TableReturn> extractTables(ExtractTablesOptions extractTablesOptions); ServiceCall<CompareReturn> compareDocuments(
      CompareDocumentsOptions compareDocumentsOptions); ServiceCall<FeedbackReturn> addFeedback(AddFeedbackOptions addFeedbackOptions); ServiceCall<FeedbackList> listFeedback(ListFeedbackOptions listFeedbackOptions); ServiceCall<FeedbackList> listFeedback(); ServiceCall<GetFeedback> getFeedback(GetFeedbackOptions getFeedbackOptions); ServiceCall<FeedbackDeleted> deleteFeedback(DeleteFeedbackOptions deleteFeedbackOptions); ServiceCall<BatchStatus> createBatch(CreateBatchOptions createBatchOptions); ServiceCall<Batches> listBatches(ListBatchesOptions listBatchesOptions); ServiceCall<Batches> listBatches(); ServiceCall<BatchStatus> getBatch(GetBatchOptions getBatchOptions); ServiceCall<BatchStatus> updateBatch(UpdateBatchOptions updateBatchOptions);  }
@Test public void testAddFeedback() throws InterruptedException { server.enqueue(jsonResponse(addFeedbackResponse)); Location location = new Location.Builder().begin(BEGIN).end(END).build(); Category category = new Category.Builder().build(); TypeLabel typeLabel = new TypeLabel.Builder().build(); OriginalLabelsIn originalLabelsIn = new OriginalLabelsIn.Builder() .categories(Collections.singletonList(category)) .types(Collections.singletonList(typeLabel)) .build(); UpdatedLabelsIn updatedLabelsIn = new UpdatedLabelsIn.Builder() .categories(Collections.singletonList(category)) .types(Collections.singletonList(typeLabel)) .build(); FeedbackDataInput feedbackDataInput = new FeedbackDataInput.Builder() .feedbackType(FEEDBACK_TYPE) .location(location) .originalLabels(originalLabelsIn) .text(TEXT) .updatedLabels(updatedLabelsIn) .build(); AddFeedbackOptions addFeedbackOptions = new AddFeedbackOptions.Builder().feedbackData(feedbackDataInput).build(); FeedbackReturn response = service.addFeedback(addFeedbackOptions).execute().getResult(); RecordedRequest request = server.takeRequest(); assertEquals(FEEDBACK_PATH, request.getPath()); assertEquals(FEEDBACK_ID, response.getFeedbackId()); assertEquals(USER_ID, response.getUserId()); assertEquals(COMMENT, response.getComment()); assertEquals(testDateValue, response.getCreated()); assertEquals(FEEDBACK_TYPE, response.getFeedbackData().getFeedbackType()); assertEquals(TITLE, response.getFeedbackData().getDocument().title()); assertEquals(HASH, response.getFeedbackData().getDocument().hash()); assertEquals(MODEL_ID, response.getFeedbackData().getModelId()); assertEquals(MODEL_VERSION, response.getFeedbackData().getModelVersion()); assertEquals(BEGIN, response.getFeedbackData().getLocation().begin()); assertEquals(END, response.getFeedbackData().getLocation().end()); assertEquals(TEXT, response.getFeedbackData().getText()); assertEquals( NATURE, response.getFeedbackData().getOriginalLabels().getTypes().get(0).label().nature()); assertEquals( PARTY, response.getFeedbackData().getOriginalLabels().getTypes().get(0).label().party()); assertEquals( PROVENANCE_ID, response.getFeedbackData().getOriginalLabels().getTypes().get(0).provenanceIds().get(0)); assertEquals( LABEL, response.getFeedbackData().getOriginalLabels().getCategories().get(0).label()); assertEquals( PROVENANCE_ID, response .getFeedbackData() .getOriginalLabels() .getCategories() .get(0) .provenanceIds() .get(0)); assertEquals( OriginalLabelsOut.Modification.ADDED, response.getFeedbackData().getOriginalLabels().getModification()); assertEquals( NATURE, response.getFeedbackData().getUpdatedLabels().getTypes().get(0).label().nature()); assertEquals( PARTY, response.getFeedbackData().getUpdatedLabels().getTypes().get(0).label().party()); assertEquals( PROVENANCE_ID, response.getFeedbackData().getUpdatedLabels().getTypes().get(0).provenanceIds().get(0)); assertEquals( LABEL, response.getFeedbackData().getUpdatedLabels().getCategories().get(0).label()); assertEquals( PROVENANCE_ID, response .getFeedbackData() .getUpdatedLabels() .getCategories() .get(0) .provenanceIds() .get(0)); assertEquals( UpdatedLabelsOut.Modification.ADDED, response.getFeedbackData().getUpdatedLabels().getModification()); assertEquals(REFRESH_CURSOR, response.getFeedbackData().getPagination().getRefreshCursor()); assertEquals(NEXT_CURSOR, response.getFeedbackData().getPagination().getNextCursor()); assertEquals(REFRESH_URL, response.getFeedbackData().getPagination().getRefreshUrl()); assertEquals(NEXT_URL, response.getFeedbackData().getPagination().getNextUrl()); assertEquals(TOTAL, response.getFeedbackData().getPagination().getTotal()); }