Skip to content

test: lock both owners of membership and role joins (#297) - #352

Merged
fjlopez merged 1 commit into
devfrom
test/297-join-association-writes
Oct 22, 2026
Merged

fjlopez merged 1 commit into
devfrom
test/297-join-association-writes

Conversation

@fjlopez

@fjlopez fjlopez commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Both sides of STM_GRP_TER and STM_APP_ROL stay owning @ManyToMany associations. This pull request does not mark either side mappedBy, and it does not change entity mappings, the schema, or Liquibase.
  • TerritoryMembershipAssociationWriteTest locks PUT /api/territories/{id}/members and PUT /api/territories/{id}/memberOf as text/uri-list. Each write inserts one STM_GRP_TER row. GET members of the parent contains the child, and GET memberOf of the child contains the parent. Replacing members leaves the member-of row, and replacing memberOf leaves the members row.
  • ApplicationRoleAssociationWriteTest locks the same two writes and the same non-interference check for PUT /api/applications/{id}/availableRoles and PUT /api/roles/{id}/applications on STM_APP_ROL.

Related to #297. The issue stays open.

Test plan

  • ./gradlew test --tests org.sitmun.domain.territory.TerritoryMembershipAssociationWriteTest --tests org.sitmun.domain.application.ApplicationRoleAssociationWriteTest
  • Pre-commit ./gradlew spotlessCheck, ./gradlew test, and ./gradlew jacocoTestReport
  • Confirm Territory.members, Territory.memberOf, Application.availableRoles, and Role.applications are unchanged on dev

PUT of members and memberOf, and of availableRoles and applications,
keeps each side as an owning association. Replacing one side leaves
the other side's join row.
@fjlopez
fjlopez merged commit e2c1300 into dev Oct 22, 2026
1 check passed
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