1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Add AnnotationSythesizer API

Closes gh-13234
Closes gh-13490
Closes gh-15097
This commit is contained in:
Josh Cummings
2024-07-18 09:15:04 -06:00
parent e3438aa36a
commit c736e075c1
17 changed files with 1183 additions and 464 deletions
@@ -47,6 +47,8 @@ public class PreAuthorizeAspectTests {
private PrePostSecured prePostSecured = new PrePostSecured();
private MultipleInterfaces multiple = new MultipleInterfaces();
@BeforeEach
public final void setUp() {
MockitoAnnotations.initMocks(this);
@@ -110,6 +112,12 @@ public class PreAuthorizeAspectTests {
.isThrownBy(() -> this.secured.myObject().denyAllMethod());
}
@Test
public void multipleInterfacesPreAuthorizeAllows() {
// aspectj doesn't inherit annotations
this.multiple.securedMethod();
}
interface SecuredInterface {
@PreAuthorize("hasRole('X')")
@@ -177,4 +185,19 @@ public class PreAuthorizeAspectTests {
}
interface AnotherSecuredInterface {
@PreAuthorize("hasRole('Y')")
void securedMethod();
}
static class MultipleInterfaces implements SecuredInterface, AnotherSecuredInterface {
@Override
public void securedMethod() {
}
}
}