Skip to content

ArchUnit doesn't detect generic forbidden dependencies #1126

Closed Answered by hankem
BessetThomas asked this question in Q&A
Discussion options

You must be logged in to vote

https://stackoverflow.com/a/76547361/13134095:

Unless you use a specific API of your entity (i.e. call a method or access a field) in your controller, ArchUnit cannot detect a dependency (see also #1012, which basically describes the same use case).

This is unrelated to generics; you wouldn't get a violation even if your service returned a non-Optional entity E.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BessetThomas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants