-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This commit adds an EntitlementTest annotation that can be used on classes containing test actions for entitlements. The annotation mirrors the parameters of CheckAction. Only file check actions are currently converted, the rest can be moved and annotated as followups. Note that the check action name is simply the method name, no fancy name manipulation is done.
- Loading branch information
Showing
3 changed files
with
223 additions
and
135 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ment-test-plugin/src/main/java/org/elasticsearch/entitlement/qa/test/EntitlementTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
package org.elasticsearch.entitlement.qa.test; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface EntitlementTest { | ||
enum ExpectedAccess { | ||
PLUGINS, | ||
ES_MODULES_ONLY, | ||
ALWAYS_DENIED | ||
} | ||
|
||
ExpectedAccess expectedAccess(); | ||
|
||
int fromJavaVersion() default -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.