Skip to content

Commit

Permalink
Merge pull request #1063 from watson-developer-cloud/detect-secrets-hide
Browse files Browse the repository at this point in the history
Remove detect secrets files
  • Loading branch information
lpatino10 authored May 10, 2019
2 parents 00bca43 + f083f3c commit 9746433
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 35 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ package-lock.json
*.mlmodel
.openapi-generator-ignore
.openapi-generator/
package-lock.json
package-lock.json
.pre-commit-config.yaml
.secrets.baseline
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .secrets.baseline

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.ibm.watson.compare_comply.v1.model.AddFeedbackOptions;
import com.ibm.watson.compare_comply.v1.model.BatchStatus;
import com.ibm.watson.compare_comply.v1.model.Batches;
import com.ibm.watson.compare_comply.v1.model.Category;
import com.ibm.watson.compare_comply.v1.model.ClassifyElementsOptions;
import com.ibm.watson.compare_comply.v1.model.ClassifyReturn;
import com.ibm.watson.compare_comply.v1.model.CompareDocumentsOptions;
Expand All @@ -20,10 +21,12 @@
import com.ibm.watson.compare_comply.v1.model.GetFeedback;
import com.ibm.watson.compare_comply.v1.model.GetFeedbackOptions;
import com.ibm.watson.compare_comply.v1.model.HTMLReturn;
import com.ibm.watson.compare_comply.v1.model.Label;
import com.ibm.watson.compare_comply.v1.model.Location;
import com.ibm.watson.compare_comply.v1.model.OriginalLabelsIn;
import com.ibm.watson.compare_comply.v1.model.ShortDoc;
import com.ibm.watson.compare_comply.v1.model.TableReturn;
import com.ibm.watson.compare_comply.v1.model.TypeLabel;
import com.ibm.watson.compare_comply.v1.model.UpdateBatchOptions;
import com.ibm.watson.compare_comply.v1.model.UpdatedLabelsIn;
import org.junit.Before;
Expand All @@ -32,6 +35,8 @@

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -111,20 +116,56 @@ public void testCompareDocuments() throws FileNotFoundException {
public void testFeedbackOperations() {
String userId = "lp_java";
String comment = "could be better";
String text = "This is some text from a contract about something.";
String text = "1. IBM will provide a Senior Managing Consultant / expert resource, for up to 80 hours, to assist "
+ "Florida Power & Light (FPL) with the creation of an IT infrastructure unit cost model for existing "
+ "infrastructure.";
ShortDoc shortDoc = new ShortDoc();
shortDoc.setTitle("doc title");
shortDoc.setHash("");
Location location = new Location();
location.setBegin(0L);
location.setEnd(1L);
location.setBegin(241);
location.setEnd(237);
OriginalLabelsIn originalLabelsIn = new OriginalLabelsIn();
Label label1 = new Label();
label1.setNature("Obligation");
label1.setParty("IBM");
List<String> ids1 = Arrays.asList("85f5981a-ba91-44f5-9efa-0bd22e64b7bc", "ce0480a1-5ef1-4c3e-9861-3743b5610795");
TypeLabel typeLabel1 = new TypeLabel();
typeLabel1.setLabel(label1);
typeLabel1.setProvenanceIds(ids1);
Label label2 = new Label();
label2.setNature("End User");
label2.setParty("Exclusion");
List<String> ids2 = Arrays.asList("85f5981a-ba91-44f5-9efa-0bd22e64b7bc", "ce0480a1-5ef1-4c3e-9861-3743b5610795");
TypeLabel typeLabel2 = new TypeLabel();
typeLabel2.setLabel(label2);
typeLabel2.setProvenanceIds(ids2);
List<TypeLabel> types = Arrays.asList(typeLabel1, typeLabel2);
originalLabelsIn.setTypes(types);
Category category1 = new Category();
category1.setLabel(Category.Label.RESPONSIBILITIES);
category1.setProvenanceIds(new ArrayList<String>());
Category category2 = new Category();
category2.setLabel(Category.Label.AMENDMENTS);
category2.setProvenanceIds(new ArrayList<String>());
originalLabelsIn.setCategories(Arrays.asList(category1, category2));
UpdatedLabelsIn updatedLabelsIn = new UpdatedLabelsIn();
Label label3 = new Label();
label3.setNature("Disclaimer");
label3.setParty("buyer");
TypeLabel typeLabel3 = new TypeLabel();
typeLabel3.setLabel(label3);
updatedLabelsIn.setTypes(Arrays.asList(typeLabel1, typeLabel3));
updatedLabelsIn.setCategories(Arrays.asList(category1, category2));
FeedbackDataInput feedbackDataInput = new FeedbackDataInput();
feedbackDataInput.setDocument(shortDoc);
feedbackDataInput.setLocation(location);
feedbackDataInput.setText(text);
feedbackDataInput.setOriginalLabels(originalLabelsIn);
feedbackDataInput.setUpdatedLabels(updatedLabelsIn);
feedbackDataInput.setFeedbackType("element_classification");
feedbackDataInput.setModelId("contracts");
feedbackDataInput.setModelVersion("11.00");

AddFeedbackOptions addFeedbackOptions = new AddFeedbackOptions.Builder()
.userId(userId)
Expand All @@ -141,7 +182,7 @@ public void testFeedbackOperations() {
.getFeedback(getFeedbackOptions)
.addHeader("x-watson-metadata", "customer_id=sdk-test-customer-id")
.execute().getResult();
assertEquals(comment, getFeedback.getComment());
assertEquals(text, getFeedback.getFeedbackData().getText());

DeleteFeedbackOptions deleteFeedbackOptions = new DeleteFeedbackOptions.Builder()
.feedbackId(feedbackId)
Expand Down

0 comments on commit 9746433

Please sign in to comment.