Eric
01/05/2024, 2:14 PMhasAnnotationOf
work on meta-annotations?Eric
01/05/2024, 2:39 PMKoAnnotationDeclaration
doesn't implement itselfEric
01/05/2024, 2:42 PM@Test
fun `konsist test rest functions have @PreAuthorize annotation`() {
controllers
.functions()
.assertTrue {
it.hasAnnotationOf<PreAuthorize>() || it.annotations
.filterNot { annotation -> annotation.name == "Suppress" }
.any { annotation ->
val clazz = Class.forName(annotation.fullyQualifiedName)
clazz.isAnnotationPresent<PreAuthorize>()
}
}
}