Run single Spring Boot test with VM options (profile, etc) specified for whole Test

Answered

Hi,

I have a Spring Boot project with Spock tests that I run from Intellij Ultimate. For each individual Spec, I have configured a JUnit run configuration like so:

When I execute Run->APNSApiSpec or the autogenerated Run->test in my-test-package, everything works perfectly (my VM options are used). 

But, I am unable to figure out how to run a single test with the options configured for the class (short of create a run config per test). When I click the play button (as seen in the photo below)

I see "No profile is set" in my spring application logs, which means that the class level configuration is not applied to the single test. Any help is much appreciated

0
2 comments

Hello,

When you click play button temporary configuration is created based on template. You could cjange that template in "Run/Debug Configurations | Templates", so new configuration will be created with predefined options.

0
Avatar
Permanently deleted user

Thanks for the quick response. Creating a template works for setting project wide defaults, which is a fine level of granularity for me at the moment.

Cheers

0

Please sign in to leave a comment.