2424import com .ibm .watson .compare_comply .v1 .model .CompareDocumentsOptions ;
2525import com .ibm .watson .compare_comply .v1 .model .CompareReturn ;
2626import com .ibm .watson .compare_comply .v1 .model .ContractAmts ;
27+ import com .ibm .watson .compare_comply .v1 .model .ContractTerms ;
2728import com .ibm .watson .compare_comply .v1 .model .ContractType ;
2829import com .ibm .watson .compare_comply .v1 .model .ConvertToHtmlOptions ;
2930import com .ibm .watson .compare_comply .v1 .model .CreateBatchOptions ;
4445import com .ibm .watson .compare_comply .v1 .model .OriginalLabelsIn ;
4546import com .ibm .watson .compare_comply .v1 .model .OriginalLabelsOut ;
4647import com .ibm .watson .compare_comply .v1 .model .Parties ;
48+ import com .ibm .watson .compare_comply .v1 .model .PaymentTerms ;
4749import com .ibm .watson .compare_comply .v1 .model .ShortDoc ;
4850import com .ibm .watson .compare_comply .v1 .model .TableReturn ;
4951import com .ibm .watson .compare_comply .v1 .model .TerminationDates ;
@@ -133,6 +135,9 @@ public class CompareComplyTest extends WatsonServiceUnitTest {
133135 private static final String NAME = "name" ;
134136 private static final Long PAGE_LIMIT = 7L ;
135137 private static final String CURSOR = "cursor" ;
138+ private static final String VALUE = "value" ;
139+ private static final String UNIT = "unit" ;
140+ private static final Double NUMERIC_VALUE = 21.0 ;
136141
137142 private static final String CONVERT_TO_HTML_PATH = String .format (
138143 "/v1/html_conversion?version=%s" ,
@@ -224,6 +229,8 @@ public void setUp() throws Exception {
224229 service .setEndPoint (getMockWebServerUrl ());
225230 }
226231
232+ // --- MODELS ---
233+
227234 @ Test
228235 public void testAddFeedbackOptions () {
229236 FeedbackDataInput feedbackDataInput = new FeedbackDataInput ();
@@ -522,6 +529,8 @@ public void testUpdatedLabelsIn() {
522529 assertEquals (typeLabel , updatedLabelsIn .getTypes ().get (0 ));
523530 }
524531
532+ // --- METHODS ---
533+
525534 @ Test
526535 public void testConvertToHtml () throws FileNotFoundException , InterruptedException {
527536 server .enqueue (jsonResponse (convertToHtmlResponse ));
@@ -631,6 +640,12 @@ public void testClassifyElements() throws FileNotFoundException, InterruptedExce
631640 assertEquals (BEGIN , response .getTables ().get (0 ).getKeyValuePairs ().get (0 ).getValue ().getLocation ().getBegin ());
632641 assertEquals (END , response .getTables ().get (0 ).getKeyValuePairs ().get (0 ).getValue ().getLocation ().getEnd ());
633642 assertEquals (TEXT , response .getTables ().get (0 ).getKeyValuePairs ().get (0 ).getValue ().getText ());
643+ assertEquals (TEXT , response .getTables ().get (0 ).getTitle ().getText ());
644+ assertEquals (BEGIN , response .getTables ().get (0 ).getTitle ().getLocation ().getBegin ());
645+ assertEquals (END , response .getTables ().get (0 ).getTitle ().getLocation ().getEnd ());
646+ assertEquals (TEXT , response .getTables ().get (0 ).getContexts ().get (0 ).getText ());
647+ assertEquals (BEGIN , response .getTables ().get (0 ).getContexts ().get (0 ).getLocation ().getBegin ());
648+ assertEquals (END , response .getTables ().get (0 ).getContexts ().get (0 ).getLocation ().getEnd ());
634649 assertEquals (TEXT , response .getDocumentStructure ().getSectionTitles ().get (0 ).getText ());
635650 assertEquals (BEGIN , response .getDocumentStructure ().getSectionTitles ().get (0 ).getLocation ().getBegin ());
636651 assertEquals (END , response .getDocumentStructure ().getSectionTitles ().get (0 ).getLocation ().getEnd ());
@@ -646,6 +661,8 @@ public void testClassifyElements() throws FileNotFoundException, InterruptedExce
646661 response .getDocumentStructure ().getLeadingSentences ().get (0 ).getElementLocations ().get (0 ).getBegin ());
647662 assertEquals (END ,
648663 response .getDocumentStructure ().getLeadingSentences ().get (0 ).getElementLocations ().get (0 ).getEnd ());
664+ assertEquals (BEGIN , response .getDocumentStructure ().getParagraphs ().get (0 ).getLocation ().getBegin ());
665+ assertEquals (END , response .getDocumentStructure ().getParagraphs ().get (0 ).getLocation ().getEnd ());
649666 assertEquals (PARTY , response .getParties ().get (0 ).getParty ());
650667 assertEquals (Parties .Importance .UNKNOWN , response .getParties ().get (0 ).getImportance ());
651668 assertEquals (ROLE , response .getParties ().get (0 ).getRole ());
@@ -654,22 +671,55 @@ public void testClassifyElements() throws FileNotFoundException, InterruptedExce
654671 assertEquals (END , response .getParties ().get (0 ).getAddresses ().get (0 ).getLocation ().getEnd ());
655672 assertEquals (NAME , response .getParties ().get (0 ).getContacts ().get (0 ).getName ());
656673 assertEquals (ROLE , response .getParties ().get (0 ).getContacts ().get (0 ).getRole ());
674+ assertEquals (TEXT , response .getParties ().get (0 ).getMentions ().get (0 ).getText ());
675+ assertEquals (BEGIN , response .getParties ().get (0 ).getMentions ().get (0 ).getLocation ().getBegin ());
676+ assertEquals (END , response .getParties ().get (0 ).getMentions ().get (0 ).getLocation ().getEnd ());
657677 assertEquals (TEXT , response .getEffectiveDates ().get (0 ).getText ());
658678 assertEquals (BEGIN , response .getEffectiveDates ().get (0 ).getLocation ().getBegin ());
659679 assertEquals (END , response .getEffectiveDates ().get (0 ).getLocation ().getEnd ());
660680 assertEquals (EffectiveDates .ConfidenceLevel .HIGH , response .getEffectiveDates ().get (0 ).getConfidenceLevel ());
681+ assertEquals (TEXT_NORMALIZED , response .getEffectiveDates ().get (0 ).getTextNormalized ());
682+ assertEquals (PROVENANCE_ID , response .getEffectiveDates ().get (0 ).getProvenanceIds ().get (0 ));
661683 assertEquals (TEXT , response .getContractAmounts ().get (0 ).getText ());
662684 assertEquals (BEGIN , response .getContractAmounts ().get (0 ).getLocation ().getBegin ());
663685 assertEquals (END , response .getContractAmounts ().get (0 ).getLocation ().getEnd ());
664686 assertEquals (ContractAmts .ConfidenceLevel .HIGH , response .getContractAmounts ().get (0 ).getConfidenceLevel ());
687+ assertEquals (TEXT , response .getContractAmounts ().get (0 ).getText ());
688+ assertEquals (TEXT_NORMALIZED , response .getContractAmounts ().get (0 ).getTextNormalized ());
689+ assertEquals (VALUE , response .getContractAmounts ().get (0 ).getInterpretation ().getValue ());
690+ assertEquals (NUMERIC_VALUE , response .getPaymentTerms ().get (0 ).getInterpretation ().getNumericValue ());
691+ assertEquals (UNIT , response .getContractAmounts ().get (0 ).getInterpretation ().getUnit ());
692+ assertEquals (PROVENANCE_ID , response .getContractAmounts ().get (0 ).getProvenanceIds ().get (0 ));
693+ assertEquals (BEGIN , response .getContractAmounts ().get (0 ).getLocation ().getBegin ());
694+ assertEquals (END , response .getContractAmounts ().get (0 ).getLocation ().getEnd ());
665695 assertEquals (TEXT , response .getTerminationDates ().get (0 ).getText ());
666696 assertEquals (BEGIN , response .getTerminationDates ().get (0 ).getLocation ().getBegin ());
667697 assertEquals (END , response .getTerminationDates ().get (0 ).getLocation ().getEnd ());
668698 assertEquals (TerminationDates .ConfidenceLevel .HIGH , response .getTerminationDates ().get (0 ).getConfidenceLevel ());
669- assertEquals (TEXT , response .getContractType ().get (0 ).getText ());
670- assertEquals (BEGIN , response .getContractType ().get (0 ).getLocation ().getBegin ());
671- assertEquals (END , response .getContractType ().get (0 ).getLocation ().getEnd ());
672- assertEquals (ContractType .ConfidenceLevel .HIGH , response .getContractType ().get (0 ).getConfidenceLevel ());
699+ assertEquals (TEXT_NORMALIZED , response .getTerminationDates ().get (0 ).getTextNormalized ());
700+ assertEquals (PROVENANCE_ID , response .getTerminationDates ().get (0 ).getProvenanceIds ().get (0 ));
701+ assertEquals (TEXT , response .getContractTypes ().get (0 ).getText ());
702+ assertEquals (BEGIN , response .getContractTypes ().get (0 ).getLocation ().getBegin ());
703+ assertEquals (END , response .getContractTypes ().get (0 ).getLocation ().getEnd ());
704+ assertEquals (ContractType .ConfidenceLevel .HIGH , response .getContractTypes ().get (0 ).getConfidenceLevel ());
705+ assertEquals (ContractTerms .ConfidenceLevel .HIGH , response .getContractTerms ().get (0 ).getConfidenceLevel ());
706+ assertEquals (TEXT , response .getContractTerms ().get (0 ).getText ());
707+ assertEquals (TEXT_NORMALIZED , response .getContractTerms ().get (0 ).getTextNormalized ());
708+ assertEquals (VALUE , response .getContractTerms ().get (0 ).getInterpretation ().getValue ());
709+ assertEquals (NUMERIC_VALUE , response .getContractTerms ().get (0 ).getInterpretation ().getNumericValue ());
710+ assertEquals (UNIT , response .getContractTerms ().get (0 ).getInterpretation ().getUnit ());
711+ assertEquals (PROVENANCE_ID , response .getContractTerms ().get (0 ).getProvenanceIds ().get (0 ));
712+ assertEquals (BEGIN , response .getContractTerms ().get (0 ).getLocation ().getBegin ());
713+ assertEquals (END , response .getContractTerms ().get (0 ).getLocation ().getEnd ());
714+ assertEquals (PaymentTerms .ConfidenceLevel .HIGH , response .getPaymentTerms ().get (0 ).getConfidenceLevel ());
715+ assertEquals (TEXT , response .getPaymentTerms ().get (0 ).getText ());
716+ assertEquals (TEXT_NORMALIZED , response .getPaymentTerms ().get (0 ).getTextNormalized ());
717+ assertEquals (VALUE , response .getPaymentTerms ().get (0 ).getInterpretation ().getValue ());
718+ assertEquals (NUMERIC_VALUE , response .getPaymentTerms ().get (0 ).getInterpretation ().getNumericValue ());
719+ assertEquals (UNIT , response .getPaymentTerms ().get (0 ).getInterpretation ().getUnit ());
720+ assertEquals (PROVENANCE_ID , response .getPaymentTerms ().get (0 ).getProvenanceIds ().get (0 ));
721+ assertEquals (BEGIN , response .getPaymentTerms ().get (0 ).getLocation ().getBegin ());
722+ assertEquals (END , response .getPaymentTerms ().get (0 ).getLocation ().getEnd ());
673723 }
674724
675725 @ Test
0 commit comments