aglinxinyuan opened a new issue, #5694:
URL: https://github.com/apache/texera/issues/5694
### 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
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]