Skip to content

test(avro-to-json): add unit tests for avro_init configuration parsing #359

@WilliamBerryiii

Description

@WilliamBerryiii

Description

Follow-up from PR #357 review comment by @auyidi1.

All 7 wireFormat tests added in #357 call parse_with_schema_inner directly. There is no unit test coverage for the avro_init configuration parsing logic itself.

Missing Test Coverage

The following scenarios need unit tests:

  • Case-insensitive matching — e.g., "CONFLUENT", "Confluent", " raw " (trim + lowercase)
  • Unknown value defaulting — e.g., "invalid"Auto with warning
  • Missing wireFormat — defaults to Auto
  • OnceLock::set behavior — the let _ = WIRE_FORMAT.set(...) silently ignores errors if called twice

Location

src/500-application/512-avro-to-json/operators/avro-to-json/src/lib.rs

Context

PR #357 introduced the WireFormat enum and avro_init configuration parsing with trim().to_lowercase() transformations. While integration testing may catch some of these, dedicated unit tests for the config parsing logic would be valuable given the string transformations involved.

Related

Metadata

Metadata

Assignees

Labels

testingTest infrastructure and test files

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions