Skip to content

add unit test coverage for port-identity serde helpers #4953

Description

@aglinxinyuan

The org.apache.texera.amber.util.serde package contains three small Jackson / VFS-URI serde helpers, none of which is unit-tested:

File Role
GlobalPortIdentitySerde.scala Custom string format (logicalOpId=…,layerName=…,portId=…,isInternal=…,isInput=…) used by VFS URIs to embed a GlobalPortIdentity without underscores (which would clash with the VFS URI parser).
PortIdentityKeySerializer.scala Jackson JsonSerializer for PortIdentity map keys; also exposes portIdToString(PortIdentity) as \"id_internal\".
PortIdentityKeyDeserializer.scala Jackson KeyDeserializer paired with the serializer.

Each is referenced by load-bearing code (VFSURIFactory, JSONUtils.objectMapper setup, WorkflowExecutionsResource), so a typo in any of these strings would silently misroute deserialized state.

Coverage to add

  • GlobalPortIdentitySerde.serializeAsString / deserializeFromString round-trip for representative inputs (positive); IllegalArgumentException on a malformed string and on individual missing/garbled fields (negative).
  • PortIdentityKeySerializer.portIdToString exact format pin (\"id_internal\"); and the Jackson serializer wired into a real ObjectMapper round-tripping a Map[PortIdentity, V] (key-serialize → key-deserialize equals identity).
  • PortIdentityKeyDeserializer.deserializeKey happy-path + bad-input behavior (e.g., underscore missing, internal flag not boolean).

Priority

P3 - Low

Task Type

  • Testing / QA

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions