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.
Background
ChangeSetStacksupports 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()andpop()return null for an empty stack.set()lazily creates the current change set.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
ChangeSetStack,EntityChangeSet, andEntityKey.