in src/main/java/com/epam/digital/data/platform/restapi/core/audit/ControllerAuditAspect.java [137:152]
private Class<? extends Annotation> getAnnotation(ProceedingJoinPoint joinPoint) {
var annotations = Arrays.stream(((MethodSignature) joinPoint.getSignature())
.getMethod()
.getAnnotations())
.map(Annotation::annotationType)
.collect(Collectors.toCollection(ArrayList::new));
annotations.retainAll(httpAnnotations);
if (annotations.size() != 1) {
throw new AuditException(
String.format(
"The request handler must have exactly one mapping annotation, but has %d: %s",
annotations.size(), annotations));
}
return annotations.get(0);
}