Is there any way to enforce a rule like this one with ArchUnit : The issue here is that beCalledInClassesThat does not exists and I don’t find anything that will allow me to implement such a test. Answer Whenever you miss something in the predefined fluent API, try to define a custom predicate/condition. In your case: does this work for
Advertisement
Tag: archunit
ArchUnit – is there a way to check package access with a generic placeholder?
I would like to check whether FOO.model is only accessed by FOO.service and BAR.model is only accessed by BAR.service and so on. Is there a way to achieve this with ArchUnit? Like (pseudocode) I’m aware I could write a test that iterates over all FOO, BAR etc packages, or write a separate test for every package, but I’m looking for
How to validate that a method annotation is using an attribute with an specific value using archunit
I have an @Audit annotation, it has many optional attributes, I need to enforce the use of one boolean attribute useAccount = true for certain packages. I am trying to use archunit to accomplish this …
Advertisement