@@ -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
@@ -454,14 +455,13 @@ void rawTexts_mustBeAccessible() throws IOException {
454455 Inference inf = resp .getInference ();
455456 assertNotNull (inf );
456457
457- InferenceResultOptions opts = inf .getResult (). getOptions ();
458+ InferenceActiveOptions opts = inf .getActiveOptions ();
458459 assertNotNull (opts , "Options should not be null" );
459460
460- List < RawText > rawTexts = opts . getRawTexts ();
461- assertEquals (2 , rawTexts .size ());
461+ RawText rawText = inf . getResult (). getRawText ();
462+ assertEquals (2 , rawText . getPages () .size ());
462463
463- RawText first = rawTexts .get (0 );
464- assertEquals (0 , first .getPage ());
464+ RawTextPage first = rawText .getPages ().get (0 );
465465 assertEquals ("This is the raw text of the first page..." , first .getContent ());
466466 }
467467 }
0 commit comments