Given that I have the following properties:
values[0]=A
values[1]=B
values[2]=C
I need to check that values
contains A in a @ConditionalOnExpression
annotation. As of yet, I have not found an example of how to do it. I have tried this, but it does not work:
@ConditionalOnExpression("${values}.contains('A')")
It results in:
java.lang.IllegalStateException: Failed to load ApplicationContext
You need $ expresion surrounded by single quotes
@ConditionalOnExpression("'${values}'.contains('A')")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With