Skip to content
Discussion options

You must be logged in to vote

Am I going to have to implement a "EnabledOnEnv" annotation with a "matches" parameter value like "dev | test"?

Yes, you'll need to move the boolean logic to a regular expression.

Perhaps something like this:

@Target({ ElementType.TYPE, ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented @EnabledIfSystemProperty( named = "INTEGRATION_TEST_ENV", matches = "(dev|test)", disabledReason = "Not currently executing in dev or test environment") public @interface EnabledOnDevOrTestEnvironment { }

Or implement your own custom ExecutionCondition.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by davidmichaelkarr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants