Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
It would be helpful to have few hamcrest matchers, and stub-serializer/snapshot classes to ease
unit testing serializer schema related logic.
This is currently implemented in few different places already, in different ways.
For example:
- https://github.com/apache/flink/blob/master/flink-formats/flink-avro/src/test/java/org/apache/flink/formats/avro/typeutils/AvroSerializerSnapshotTest.java#L192
- https://github.com/apache/flink/blob/master/flink-core/src/test/java/org/apache/flink/api/common/typeutils/base/EnumSerializerSnapshotMigrationTest.java#L74
- https://github.com/apache/flink/blob/1850193b956b899aefd3ea84fe726e10b9359b55/flink-core/src/test/java/org/apache/flink/api/common/typeutils/TypeSerializerSnapshotMigrationTestBase.java#L533
A stub serializer, is a serializer that returns a stub snapshot, which can be configured during test setup how to behave when restoreSerializer/resolveSchemaCompatibility are called.
This would be very useful for tests that test composite serializers.
Attachments
Issue Links
- links to