Hi, I just noticed that I need the validation `has...
# konsist
y
Hi, I just noticed that I need the validation
hasAnyAnnotationsOf()
for this test example:
Copy code
Konsist
    .scopeFromProject()
    .classes()
    .properties()
    .assertFalse { it.hasAnyAnnotationsOf(Autowired::class, Inject::class) }
The main reason here is that spring supports both the
@Autowired
and
@Inject
annotation for DI.
i
Use
hasAnnotationOf
- works like
Any
- "Determines whether the declaration has at least one annotation of the specified
KClass
type"
😅 1
y
Oh the name was a bit misleading - I kinda assume that it accepts only 1 annotation 🤔
i
I am not sure if there is a perfect name here - most times devs will check one thing. So Name with
s
may be also confusing