@Test
public void deserializeUnionWithMultipleFields() {

    final Message message = TestRecords1Proto.RecordTypeUnion.newBuilder()
            .setMySimpleRecord(TestRecords1Proto.MySimpleRecord.newBuilder().setRecNo(1066L).build())
            .setMyOtherRecord(TestRecords1Proto.MyOtherRecord.newBuilder().setRecNo(1413L).build())
            .build();
    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 extra known fields"));
    assertThat((Collection<?>)ex.getLogInfo().get("fields"), not(empty()));
}