Skip to content

Fix test in AnonymousUserIntegTests #82977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.elasticsearch.xpack.core.security.action.service.CreateServiceAccountTokenResponse;
import org.elasticsearch.xpack.core.security.user.AnonymousUser;
import org.elasticsearch.xpack.security.authz.AuthorizationService;
import org.junit.BeforeClass;

import java.io.IOException;
import java.util.Map;
Expand All @@ -35,7 +36,12 @@
import static org.hamcrest.Matchers.nullValue;

public class AnonymousUserIntegTests extends SecurityIntegTestCase {
private boolean authorizationExceptionsEnabled = randomBoolean();
private static boolean authorizationExceptionsEnabled;

@BeforeClass
public static void maybeEnableAnonymousAuthorizationException() {
authorizationExceptionsEnabled = randomBoolean();
}

@Override
protected boolean addMockHttpTransport() {
Expand Down