Skip to content

test(core): cover ChangeSetStack nested-scope precedence and pop fallback #21

Description

@philipgreat

Background

ChangeSetStack supports nested save scopes, but no unit test currently protects stack precedence.

Scope

Add focused tests for non-null values in nested scopes. Explicit-null behavior is tracked separately.

Test cases

  • current() and pop() return null for an empty stack.
  • The first set() lazily creates the current change set.
  • A value in the top scope shadows the same field in a lower scope.
  • Popping the top scope restores visibility of the lower value.
  • clearCurrent() clears only the top scope.
  • changedFieldNames(key) returns the union of fields across scopes.
  • clearEntity(key) removes the entity from every scope without affecting other entities.

Acceptance criteria

  • Tests use only ChangeSetStack, EntityChangeSet, and EntityKey.
  • Nested-scope behavior is verified without reflection into the stack implementation.

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