-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Meta-Annotations #57
Comments
You're right, the predefined API doesn't support this case at the moment. However, you can add it yourself:
It's a little verbose, but it should do, what you want, if I've correctly understood your issue. Does this help you? |
Actually I was just pondering, this can be written a little shorter, by using the syntax
Should do the same thing, as the code above, i.e. accept all types that are directly annotated with |
Yep, that's just right for my requirement. Should this be part of ArchUnit, either as API or as an "how to extend"-example in the user guide? |
Glad to hear that it covers your case 😃
and the respective negations. I'll see if someone wants to contribute a PR, otherwise I'll do it myself, as soon as I get around to it (which might be a little while though, since there are so many older issues in the pipeline). |
Since I'm able to build the project now (thanks @codecholeric), I will start to work on this issue. |
Cool, thanks a lot 😃 Let me know, if you need any support! |
While implementing tests for this one, I found an issue relating to class resolving. If an annotation type is not imported directly, the information about meta-annotations are not present. Example:
@codecholeric any ideas how to proceed? |
I don't think this is an issue, but a known limitation. Imagine this structure:
If you import via One thing you could argue about though, is if the I'll think about this, but I think this is a separate issue, independently of syntax extensions, since those work fine if all necessary classes are imported. |
Add support for meta-annotations
Add support for meta-annotations
The Spring Framework allows (and encourages) to compose annotations, for example composing
@Service
and@Transactional
to@TransactionalService
With ArchUnit it should be possible to access the meta-annotations
@Service
and@Transactional
, for exampleWith 0.5.0 this test fails with
See also the Spring Annotation Programming Model.
The text was updated successfully, but these errors were encountered: