test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule public
test_class.original_string: @Rule public ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.declarator: permitAll
test_class.modifier: private
test_class.original_string: private PermitAll             permitAll;
test_class.type: PermitAll
test_class.var_name: permitAll
test_class.declarator: denyAll
test_class.modifier: private
test_class.original_string: private DenyAll               denyAll;
test_class.type: DenyAll
test_class.var_name: denyAll
test_class.declarator: rolesAllowed
test_class.modifier: private
test_class.original_string: private RolesAllowed          rolesAllowed;
test_class.type: RolesAllowed
test_class.var_name: rolesAllowed
test_class.declarator: resourceMethod
test_class.modifier: private
test_class.original_string: private GenericResourceMethod resourceMethod;
test_class.type: GenericResourceMethod
test_class.var_name: resourceMethod
test_class.declarator: securityContext
test_class.modifier: private
test_class.original_string: private SecurityContext       securityContext;
test_class.type: SecurityContext
test_class.var_name: securityContext
test_class.declarator: securityConstraint
test_class.modifier: private
test_class.original_string: private SecurityConstraint securityConstraint;
test_class.type: SecurityConstraint
test_class.var_name: securityConstraint
test_class.file: everrest-core/src/test/java/org/everrest/core/impl/method/filter/SecurityConstraintTest.java
test_class.identifier: SecurityConstraintTest
test_case.body: @Test
      public void allowsAccessWhenSecurityAnnotationAbsents() {
          when(resourceMethod.getAnnotations()).thenReturn(new Annotation[0]);
  
          securityConstraint.accept(resourceMethod, null);
      }
test_case.class_method_signature: SecurityConstraintTest.allowsAccessWhenSecurityAnnotationAbsents()
test_case.full_signature: @Test public void allowsAccessWhenSecurityAnnotationAbsents()
test_case.identifier: allowsAccessWhenSecurityAnnotationAbsents
test_case.invocations: thenReturn when getAnnotations accept
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void allowsAccessWhenSecurityAnnotationAbsents()
focal_class.file: everrest-core/src/main/java/org/everrest/core/impl/method/filter/SecurityConstraint.java
focal_class.identifier: SecurityConstraint
focal_class.interfaces: implements MethodInvokerFilter
focal_class.class_method_signature: SecurityConstraint.accept(GenericResourceMethod method, Object[] params)
focal_class.full_signature: @Override public void accept(GenericResourceMethod method, Object[] params)
focal_class.identifier: accept
focal_class.modifiers: @Override public
focal_class.parameters: (GenericResourceMethod method, Object[] params)
focal_class.return: void
focal_class.signature: void accept(GenericResourceMethod method, Object[] params)
focal_method.body: @Override
      public void accept(GenericResourceMethod method, Object[] params) throws WebApplicationException {
          for (Annotation annotation : method.getAnnotations()) {
              Class<?> annotationType = annotation.annotationType();
              if (annotationType == PermitAll.class) {
                  return;
              } else if (annotationType == DenyAll.class) {
                  throw new WebApplicationException(Response.status(FORBIDDEN)
                                                            .entity("User not authorized to call this method").type(TEXT_PLAIN)
                                                            .build());
              } else if (annotationType == RolesAllowed.class) {
                  SecurityContext security = ApplicationContext.getCurrent().getSecurityContext();
                  for (String role : ((RolesAllowed)annotation).value()) {
                      if (security.isUserInRole(role)) {
                          return;
                      }
                  }
                  throw new WebApplicationException(Response.status(FORBIDDEN)
                                                            .entity("User not authorized to call this method").type(TEXT_PLAIN)
                                                            .build());
              }
          }
      }
focal_method.class_method_signature: SecurityConstraint.accept(GenericResourceMethod method, Object[] params)
focal_method.full_signature: @Override public void accept(GenericResourceMethod method, Object[] params)
focal_method.identifier: accept
focal_method.invocations: getAnnotations annotationType build type entity status getSecurityContext getCurrent value isUserInRole build type entity status
focal_method.modifiers: @Override public
focal_method.parameters: (GenericResourceMethod method, Object[] params)
focal_method.return: void
focal_method.signature: void accept(GenericResourceMethod method, Object[] params)