Encoding backwards-compatibility for unit tests