Grails 3.1.9 Functional Test Port
With Grails 3.1.9 and above we now get a default port for Functional tests that is randomly assigned. This is a great feature that was added in with this commit.
While this is a nice addition our tests which were not using Geb were left broken this is due to the fact we now need to know what port was selected for a given run of the tests. So our old test:
Was broken since the app no longer started on 8080, but we can fix that with a new property that the @Integration
annotation adds which is serverPort
so the test becomes:
If you are wondering how serverPort
is actually set you can see it happening inside IntegrationTestMixinTransformation. It will add a property to the test class with the port.