Chapter 2. Specifying test ports

By default, Quarkus tests run on port 8081 to avoid conflict with the running application. This allows you to run tests while the application is running in parallel. You can specify a different port for test connections in your application.properties file. You can use separate ports to test unsecured HTTP connections and connections secured with SSL.

Procedure

  • Set the quarkus.http.test-port and quarkus.http.test-ssl-port property in the application.properties file. Replace <port> with the number of the port that you want to use for test connections:

    quarkus.http.test-port=<port>
    quarkus.http.test-ssl-port=<port>

    You can set the port number to 0 to let the your operating system assign a random port from the range of available ports on your system.

    Note

    Quarkus provides REST Assured integration that updates the default port used by REST Assured before the tests are run, so no additional configuration is required.