@Test
public void deserializeUnionWithNoFields() {

    final Message message = TestRecords1Proto.RecordTypeUnion.getDefaultInstance();
    RecordSerializationException ex = assertThrows(RecordSerializationException.class,
            () -> serializer.deserializeUnion(metaData.getUnionDescriptor(), Tuple.from(1066L), message.toByteArray(), metaData.getVersion()));
    assertThat(ex.getMessage(), containsString("Could not deserialize union message"));
    assertThat(ex.getMessage(), containsString("there are no fields"));
    assertThat((Collection<?>)ex.getLogInfo().get("fields"), empty());
}