@Test public void testFilteringScopesWithContext() throws Exception { final SecurityContext context = new TestSecurityContext(); Annotation[] annotations; Set<String> expected; annotations = new Annotation[0]; assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(Collections.<String>emptySet())); annotations = new Annotation[] {CustomAnnotationLiteral.INSTANCE, CustomAnnotationLiteral.INSTANCE}; assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(Collections.<String>emptySet())); annotations = new Annotation[] {CustomAnnotationLiteral.INSTANCE, SecurityAnnotations .rolesAllowed("manager"), CustomAnnotationLiteral.INSTANCE}; expected = Collections.singleton(RolesAllowed.class.getName() + "_manager"); assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(expected)); annotations = new Annotation[] {SecurityAnnotations.rolesAllowed("client", "user")}; expected = Collections.singleton(RolesAllowed.class.getName() + "_user"); assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(expected)); annotations = new Annotation[] {SecurityAnnotations.permitAll()}; assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(FilteringHelper.getDefaultFilteringScope())); annotations = new Annotation[] {SecurityAnnotations.denyAll()}; assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(null)); }
static Set<String> getFilteringScopes(final Annotation[] annotations) { return getFilteringScopes(null, annotations); }
SecurityHelper { static Set<String> getFilteringScopes(final Annotation[] annotations) { return getFilteringScopes(null, annotations); } }
SecurityHelper { static Set<String> getFilteringScopes(final Annotation[] annotations) { return getFilteringScopes(null, annotations); } private  SecurityHelper(); }
SecurityHelper { static Set<String> getFilteringScopes(final Annotation[] annotations) { return getFilteringScopes(null, annotations); } private  SecurityHelper();  }
SecurityHelper { static Set<String> getFilteringScopes(final Annotation[] annotations) { return getFilteringScopes(null, annotations); } private  SecurityHelper();   }