|
22 | 22 | import static org.apache.avro.TestSchemas.ENUM2_AB_SCHEMA; |
23 | 23 | import static org.apache.avro.TestSchemas.ENUM_ABC_ENUM_DEFAULT_A_SCHEMA; |
24 | 24 | import static org.apache.avro.TestSchemas.ENUM_AB_ENUM_DEFAULT_A_SCHEMA; |
| 25 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
25 | 26 | import static org.junit.jupiter.api.Assertions.assertEquals; |
26 | 27 | import static org.junit.jupiter.api.Assertions.assertThrows; |
27 | 28 |
|
@@ -53,7 +54,7 @@ void enumDefaultNotAppliedWhenWriterFieldMissing() throws Exception { |
53 | 54 | datum.put("field2", new GenericData.EnumSymbol(writerSchema, "B")); |
54 | 55 | AvroTypeException avroTypeException = assertThrows(AvroTypeException.class, |
55 | 56 | () -> serializeWithWriterThenDeserializeWithReader(writerSchema, datum, readerSchema)); |
56 | | - assertEquals("Found Record1, expecting Record1, missing required field field1", avroTypeException.getMessage()); |
| 57 | + assertTrue(avroTypeException.getMessage().contains("Found Record1, expecting Record1, missing required field field1")); |
57 | 58 | } |
58 | 59 |
|
59 | 60 | @Test |
@@ -111,7 +112,7 @@ void fieldDefaultNotAppliedForUnknownSymbol() throws Exception { |
111 | 112 | datum.put("field1", new GenericData.EnumSymbol(writerSchema, "C")); |
112 | 113 | AvroTypeException avroTypeException = assertThrows(AvroTypeException.class, |
113 | 114 | () -> serializeWithWriterThenDeserializeWithReader(writerSchema, datum, readerSchema)); |
114 | | - assertEquals("No match for C", avroTypeException.getMessage()); |
| 115 | + assertEquals("Field \"field1\" content mismatch: No match for C", avroTypeException.getMessage()); |
115 | 116 | } |
116 | 117 |
|
117 | 118 | private GenericRecord serializeWithWriterThenDeserializeWithReader(Schema writerSchema, GenericRecord datum, |
|
0 commit comments