@@ -99,22 +99,22 @@ class CompletePrediction {
9999 @ DisplayName ("every exposed property must be valid and consistent" )
100100 void asyncPredict_whenComplete_mustExposeAllProperties () throws IOException {
101101 InferenceResponse response = loadFromResource ("v2/products/financial_document/complete.json" );
102- Inference inf = response .getInference ();
103- assertNotNull (inf , "Inference must not be null" );
104- assertEquals ("12345678-1234-1234-1234-123456789abc" , inf .getId (), "Inference ID mismatch" );
102+ Inference inference = response .getInference ();
103+ assertNotNull (inference , "Inference must not be null" );
104+ assertEquals ("12345678-1234-1234-1234-123456789abc" , inference .getId (), "Inference ID mismatch" );
105105
106- InferenceModel model = inf .getModel ();
106+ InferenceModel model = inference .getModel ();
107107 assertNotNull (model , "Model must not be null" );
108108 assertEquals ("12345678-1234-1234-1234-123456789abc" , model .getId (), "Model ID mismatch" );
109109
110- InferenceFile file = inf .getFile ();
110+ InferenceFile file = inference .getFile ();
111111 assertNotNull (file , "File must not be null" );
112112 assertEquals ("complete.jpg" , file .getName (), "File name mismatch" );
113113 assertEquals (1 , file .getPageCount (), "Page count mismatch" );
114114 assertEquals ("image/jpeg" , file .getMimeType (), "MIME type mismatch" );
115115 assertNull (file .getAlias (), "File alias must be null for this payload" );
116116
117- InferenceFields fields = inf .getResult ().getFields ();
117+ InferenceFields fields = inference .getResult ().getFields ();
118118 assertEquals (21 , fields .size (), "Expected 21 fields in the payload" );
119119
120120 SimpleField date = fields .get ("date" ).getSimpleField ();
@@ -146,7 +146,8 @@ void asyncPredict_whenComplete_mustExposeAllProperties() throws IOException {
146146 SimpleField city = customerAddr .getFields ().get ("city" ).getSimpleField ();
147147 assertEquals ("New York" , city .getValue (), "City mismatch" );
148148
149- assertNull (inf .getResult ().getOptions (), "Options must be null" );
149+ InferenceActiveOptions activeOptions = inference .getActiveOptions ();
150+ assertNotNull (activeOptions );
150151 }
151152 }
152153
@@ -451,17 +452,20 @@ class RawTexts {
451452 @ DisplayName ("raw texts option must be parsed and exposed" )
452453 void rawTexts_mustBeAccessible () throws IOException {
453454 InferenceResponse resp = loadFromResource ("v2/inference/raw_texts.json" );
454- Inference inf = resp .getInference ();
455- assertNotNull (inf );
455+ Inference inference = resp .getInference ();
456+ assertNotNull (inference );
456457
457- InferenceResultOptions opts = inf .getResult ().getOptions ();
458- assertNotNull (opts , "Options should not be null" );
458+ InferenceActiveOptions activeOptions = inference .getActiveOptions ();
459+ assertNotNull (activeOptions );
460+ assertFalse (activeOptions .getRag ());
461+ assertTrue (activeOptions .getRawText ());
462+ assertFalse (activeOptions .getPolygon ());
463+ assertFalse (activeOptions .getConfidence ());
459464
460- List < RawText > rawTexts = opts . getRawTexts ();
461- assertEquals (2 , rawTexts .size ());
465+ RawText rawText = inference . getResult (). getRawText ();
466+ assertEquals (2 , rawText . getPages () .size ());
462467
463- RawText first = rawTexts .get (0 );
464- assertEquals (0 , first .getPage ());
468+ RawTextPage first = rawText .getPages ().get (0 );
465469 assertEquals ("This is the raw text of the first page..." , first .getContent ());
466470 }
467471 }
0 commit comments