Skip to content

test(runtime): verify saveGraph merges to-one and collection relation roots #28

Description

@philipgreat

Background

TeaQLRuntime.mergeRelatedEntityRoots recursively merges independently tracked entities into the aggregate root before persistence. Both to-one and collection relations need direct protection.

Scope

Add focused runtime tests using small parent/child entity fixtures and relation metadata. Ledger ordering is tracked separately.

Test cases

  • A to-one related entity's changes are merged into the parent root.
  • Each entity in a collection relation is merged into the parent root.
  • Related entities are rebound to the parent root after merging.
  • Nested relations are traversed recursively.
  • An entity already sharing the target root is not merged twice.
  • Missing descriptors and non-relation properties do not cause failures.

Acceptance criteria

  • Tests verify observable mutation requests and shared-root identity.
  • Tests do not invoke a real database.
  • Parent, child, and nested-child fixtures are kept minimal and local to the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions