Grails integration tests

Hi,

Within the Grails view, If I right-click on MyIntegrationTest.groovy and run it individually (by choosing "MyIntegration..." from the right-click menu) the tests therein pass. The tests in this class also pass when I use the "Run Grails target" feature and specify "test-app".

However, if I right-click on Tests:integration and select Run "All Tests", some  of the tests in MyIntegrationTest fail because dependencies are not injected. The  speed with which the tests run also suggests that the Spring app  context is not being created. Is there a way to run all integration tests (or all integration & unit tests) from within IntelliJ without resorting to the Grails command line?

Thanks in advance!

0
1 comment

I had a problem with this before.  The first time you right-click on it, Run has a right-arrow choice between the Grails icon and the JUnit icon.  But after you choose, IntelliJ creates a Run Configuration for it and doesn't make/let you choose again.  You need to open Run > Edit Configurations > JUnit and minus-button the one you want to run as a test under Grails.

0

Please sign in to leave a comment.