@@ -285,6 +285,11 @@ void standardFieldTypes_mustExposeSimpleListFieldValues() throws IOException {
285285 assertThrows (IllegalStateException .class , listField ::getObjectItems );
286286 }
287287
288+ private void testObjectSubFieldSimpleString (String fieldName , SimpleField subField ) {
289+ assertTrue (fieldName .startsWith ("subfield_" ));
290+ assertEquals (subField .getValue (), subField .getStringValue ());
291+ }
292+
288293 @ Test
289294 @ DisplayName ("object list fields must be recognised" )
290295 void standardFieldTypes_mustExposeObjectListFieldValues () throws IOException {
@@ -326,8 +331,9 @@ void standardFieldTypes_mustExposeObjectListFieldValues() throws IOException {
326331 SimpleField itemSubfield1 = itemSubFields .getSimpleField ("subfield_1" );
327332 assertInstanceOf (String .class , itemSubfield1 .getValue ());
328333 for (Map .Entry <String , SimpleField > entry : itemFields .entrySet ()) {
334+ String fieldName = entry .getKey ();
329335 SimpleField subfield = entry .getValue ();
330- assertEquals ( subfield . getValue () , subfield . getStringValue () );
336+ testObjectSubFieldSimpleString ( fieldName , subfield );
331337 }
332338 }
333339
@@ -354,6 +360,7 @@ void standardFieldTypes_mustExposeObjectFieldValues() throws IOException {
354360 for (Map .Entry <String , DynamicField > entry : subFieldsDynamic .entrySet ()) {
355361 String fieldName = entry .getKey ();
356362 SimpleField subField = entry .getValue ().getSimpleField ();
363+ testObjectSubFieldSimpleString (fieldName , subField );
357364 }
358365
359366 LinkedHashMap <String , SimpleField > subFieldsSimple = fieldObject .getSimpleFields ();
@@ -363,6 +370,7 @@ void standardFieldTypes_mustExposeObjectFieldValues() throws IOException {
363370 for (Map .Entry <String , SimpleField > entry : subFieldsSimple .entrySet ()) {
364371 String fieldName = entry .getKey ();
365372 SimpleField subField = entry .getValue ();
373+ testObjectSubFieldSimpleString (fieldName , subField );
366374 }
367375 }
368376 }
0 commit comments