Skip to content

add ITs for policy entry references (eclipse-ditto/ditto#2423)#29

Open
thjaeckle wants to merge 3 commits intoeclipse-ditto:mainfrom
beyonnex-io:feature/simplify-policy-import-references
Open

add ITs for policy entry references (eclipse-ditto/ditto#2423)#29
thjaeckle wants to merge 3 commits intoeclipse-ditto:mainfrom
beyonnex-io:feature/simplify-policy-import-references

Conversation

@thjaeckle
Copy link
Copy Markdown
Member

@thjaeckle thjaeckle commented Apr 22, 2026

Summary

  • Replace entriesAdditions and importsAliases integration tests with new policy entry references tests, aligning with eclipse-ditto/ditto#2424
  • Add 4 new test classes covering CRUD, import references, local references, and combined reference scenarios (53 tests)
  • Adapt 3 existing test classes (transitive imports, importable sub-resources, search) to use import references instead of entriesAdditions
  • Delete 8 obsolete test files for removed entriesAdditions/importsAliases concepts

New test classes

Class Tests Scope
PolicyEntryReferencesIT 18 CRUD on /entries/{label}/references + referential integrity
PolicyEntryImportReferencesIT 19 Import ref behavior: thing access, template propagation
PolicyEntryLocalReferencesIT 9 Local ref behavior: subject fan-out, dynamic add/remove
PolicyEntryCombinedReferencesIT 7 Import + local refs combined, chaining, transitive

thjaeckle and others added 3 commits April 22, 2026 13:25
Replace entriesAdditions and importsAliases integration tests with
new policy entry references tests, covering import references
(inheriting resources from imported entries), local references
(inheriting subjects from local entries), combined references,
and referential integrity validation (409 on delete conflicts,
400 on broken references).

New test classes:
- PolicyEntryReferencesIT: CRUD + referential integrity (18 tests)
- PolicyEntryImportReferencesIT: import reference behavior (19 tests)
- PolicyEntryLocalReferencesIT: local reference behavior (9 tests)
- PolicyEntryCombinedReferencesIT: import + local combined (7 tests)

Adapted existing tests:
- PolicyImportTransitiveImportsIT: use import references in setup
- PolicyEntryImportableSubResourcesIT: use import references in setup
- SearchWithTransitiveImportsIT: use import references in setup

Deleted 8 obsolete test files for entriesAdditions/importsAliases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
…nvalid chaining test

- PolicyEntryReferencesIT: expect CREATED (201) on first PUT of references
  instead of NO_CONTENT (204); keep 204 for subsequent replacement PUTs
- PolicyEntryCombinedReferencesIT: remove localReferenceToEntryThatHas
  ImportReferenceChains — local references resolve one level only, they
  do not transitively inherit through other entries' import references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
- PolicyEntryReferencesIT: add AllowedImportAddition.SUBJECTS to
  template DEFAULT entry so import references with own subjects are
  accepted (Ditto now validates allowedImportAdditions at write time)
- PolicyEntryImportReferencesIT: importRefWithResourceAdditionsAllowed
  must not include own subjects when template only allows RESOURCES
- PolicyEntryImportableSubResourcesIT: fix 201-vs-204 on first PUT
  references; remove own resource from user-access entry when testing
  subject-only additions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
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