Skip to content

Add tests for the familial entity's parents and children - #169

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/abstract-familial-entity-tests
Nov 17, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
feature/abstract-familial-entity-tests

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Stage B (unit-test expansion) cycle: AbstractFamilialEntity had no direct tests. Its add/remove return values and the comma-separated UUID strings were only exercised indirectly through ActorFactory.

Summary

  • AbstractFamilialEntityTest is added with 9 characterization tests against an anonymous subclass, so Actor's behaviour plays no part.
  • Covered: empty state, addParent/addChild reporting whether the ID was new, removeParent/removeChild reporting whether it was present, parent and child sets kept separate, the getters returning the live sets, and get*UUIDsSeparatedByCommas joining with ", " in set-iteration order with no trailing separator.
  • Production code is unchanged.

Test plan

  • mvn clean test: 250 tests run, 0 failures, 0 errors (241 before this change)
  • mvn test -Dtest=AbstractFamilialEntityTest: 9 tests run, all pass

Deferred issues

No tracking issue exists for this change. The gap was found during triage.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

🤖 Generated with Claude Code

@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (adversarial; the anchor is local mvn clean test plus the CI build-and-deploy check):

  • Scope: PASS. The diff is one new test file, src/main/java/dansapps/interakt/tests/AbstractFamilialEntityTest.java (+141). No production code changed.
  • Tests-new: PASS. No new public methods were added. All 8 public methods of AbstractFamilialEntity are now exercised directly.
  • Tests-fix: not applicable. This is not a bug fix, so there is no stash-and-run.
  • Sibling structure: PASS. Package, imports and the class Javadoc follow sibling tests such as PlayerPermissionsTest. Like its siblings in tests/, the file has no copyright header.
  • Sibling renames: not applicable. Nothing was renamed.
  • Docs: PASS. No behaviour changed, so README.md, HelpCommand.java, pom.xml and compile.sh are unaffected.
  • Issue resolution: not applicable. No Closes is claimed and the PR body says so.
  • Local build+test run: PASS. mvn clean test ran 250 tests with 0 failures (241 before). -Dtest=AbstractFamilialEntityTest ran 9. CI build-and-deploy is green.
  • No stale mvn claim / no singleton reintroduction / help-commands parity / licence header: PASS or not applicable. No build files, services or commands were touched, and no stale Apache-2.0 header was copied.

Findings:

  • AbstractFamilialEntityTest.java:89 (testGettersReturnTheLiveSets): this test pins down that getParentUUIDs/getChildUUIDs expose the mutable internal sets. That is current behaviour and is recorded as characterization, not as an endorsement. If the getters are later changed to return copies, this test should be updated on purpose.
  • AbstractFamilialEntityTest.java:134 (assertJoinedInSetOrder): the expected string is built from the same HashSet's iteration order. This checks the separator format and the absence of a trailing separator, but it does not check any particular ordering, because the source does not define one. The set-equality assertion next to it checks the contents independently.

All items pass. No changes are required.

This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 603734b into main Nov 17, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/abstract-familial-entity-tests branch November 17, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant