Skip to content

GenericController cleanup - #1016

Merged
dennisvang merged 33 commits into
masterfrom
dev/generic-controller-cleanup
Sep 30, 2026
Merged

dennisvang merged 33 commits into
masterfrom
dev/generic-controller-cleanup

Conversation

@dennisvang

@dennisvang dennisvang commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor
  • switched GenericController to constructor injection with the help of lombok @RequiredArgsConstructor
  • removed duplication from resource access checks
  • cleanup and improved comments for getMetaDataChildren
  • renamed getResourceNameForChild to getUrlPrefix and simplified
  • renamed createLink* to createPagingLink* for clarity
  • moved logic from getMetadataChildren controller method into separate getChildResourceUris method
  • added basic GenericControllerTest with test for getChildResourceUris

todo:

  • merge commit

follow-up: port #844 to the master branch

Assisted-by: Junie Copilot

AI disclosure: Junie was used as a sanity check for my hand-made changes, resulting in some minor optimizations. Copilot (free) was used to review the PR, in the absence of any human reviewers.

@dennisvang
dennisvang force-pushed the dev/generic-controller-cleanup branch 2 times, most recently from 7763945 to 87c11d2 Compare September 25, 2026 15:27
@dennisvang
dennisvang added this pull request to stack #1019 September 25, 2026 15:54
because in an upcoming change we want to allow non-paged children as well
…s etc.

note we use 'Uri' naming instead of the actual 'IRI', to remain consistent with the existing code base
not strictly required, but prevents redundant conversion

Assisted-by: junie
to prevent redundant string formatting

Assisted-by: junie
clarifies that titles is independent of entity
based on my interpretation of what is does
@dennisvang
dennisvang force-pushed the dev/generic-controller-cleanup branch from c255339 to 1fac5ba Compare September 29, 2026 12:58
it is called Metadata (single capital) throughout the code base, not MetaData (double capital)
and make the method package-private so the test has access
with the help of SpringJUnitConfig and MockitoBean

this also fixes the interdependence issue that arose when using @SpringBootTest, where the test passed when running individually, but failed when running in a suite
@dennisvang
dennisvang marked this pull request as ready for review September 30, 2026 09:47
@dennisvang dennisvang added maintenance Maintenance tests Related to tests dev Related to development, e.g. code style, refactoring, github workflows, etc. labels Sep 30, 2026
@dennisvang
dennisvang merged commit 0be266a into master Sep 30, 2026
14 checks passed
@dennisvang
dennisvang deleted the dev/generic-controller-cleanup branch September 30, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev Related to development, e.g. code style, refactoring, github workflows, etc. maintenance Maintenance tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant