@Test
    void testOneOfTheRolesRequired() throws Throwable {
        subject = mock(Subject.class);
        when(subject.hasRole("blah")).thenReturn(true);
        when(subject.hasRole("blah2")).thenReturn(false);

        RolesAllowedAnnotationHandler handler = new RolesAllowedAnnotationHandler() {
            @Override
            protected Subject getSubject() {
                return subject;
            }
        };

        Annotation rolesAllowedAnnotation = new RolesAllowed() {
            @Override
            public String[] value() {
                return new String[] {"blah", "blah2"};
            }

            @Override
            public Class<? extends Annotation> annotationType() {
                return RolesAllowed.class;
            }
        };
        handler.assertAuthorized(rolesAllowedAnnotation);
    }
Test cases for the {@link RolesAllowedAnnotationHandler} class.
core/src/test/java/org/apache/shiro/authz/aop/RolesAllowedAnnotationHandlerTest.java