Skip to content

IntelliJ @IfProfileValue default value

In most projects that use Spring extensively there are a few tests that use @IfProfileValue to mark it as integration test, performance test or similar. When you run these with maven you do something like this:

mvn install -Dperformance-test=true

for a class annotated like this:

@IfProfileValue(name = "performance-test", value = "true")

But if I run this test in IntelliJ I get:

Test '.Tests in Progress.MyTest' ignored

which I can go around in IntelliJ by commenting out the annotation, but I would prefer if the test just ran without having to remove the line, so I don’t accidentally commit/push the class without the marker.

Is that possible?


Edit the run-configurations and set your parameter -Dperformance-test=true as VM option.

See the IDEA Run Config for detailed info.