@Test
public void allowsAccessWhenUserHasAcceptableRole() {

    when(resourceMethod.getAnnotations()).thenReturn(new Annotation[] {rolesAllowed});
    when(securityContext.isUserInRole("user")).thenReturn(true);
    securityConstraint.accept(resourceMethod, null);
}