Skip to content

add unit test coverage for visualization chart-config classes #5694

@aglinxinyuan

Description

@aglinxinyuan

Task Summary

Add dedicated unit-specs for four small Jackson-annotated config classes that back visualization operators in common/workflow-operator/operator/visualization/. Pin defaults, mutability, JSON serde, and required-field validation so accidental drift in a Jackson annotation (or default value) is caught before it ships to a chart that depends on it.

Background

Four config classes in common/workflow-operator/operator/visualization/ currently lack a dedicated unit-spec. Each is a small Jackson-serializable bag carrying a single attribute name (sometimes two) used by the corresponding visualization operator:

Source class Package Fields
TablesConfig tablesChart attributeName: EncodableString = "" (required, @NotNull)
NestedTableConfig nestedTable attributeGroup, originalName (required), newName (optional)
FigureFactoryTableConfig figureFactoryTable attributeName: EncodableString = "" (required)
DumbbellDotConfig dumbbellPlot dotValue: EncodableString = "" (required, @NotNull, integer/long/double-only via @JsonSchemaInject)

Behavior to pin

For each config class:

Surface Contract
Default field values the documented defaults ("", etc.) hold on a fresh instance
Mutability fields are var and can be assigned post-construction (mutability is part of the Jackson-bag contract — readers need this)
JSON round-trip via objectMapper.writeValueAsString + readValue preserves every field
@JsonProperty(required = true) annotation present on the documented required field(s) — verified via reflection
Distinct instances two new TablesConfig (etc.) are independent (no static-field leakage)
@NotNull annotation present on the documented @NotNull field(s) — verified via reflection

Scope

  • New spec files (one per source class per the spec-filename convention):
    • TablesConfigSpec.scala
    • NestedTableConfigSpec.scala
    • FigureFactoryTableConfigSpec.scala
    • DumbbellDotConfigSpec.scala
  • No production-code changes.
  • The Jackson serde tests use org.apache.texera.amber.util.JSONUtils.objectMapper (already wired with the project's modules).

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions