Chapter 10. Testing your Quarkus application

By default, when you test your Quarkus application, Maven uses the test configuration profile. However, you can create a custom configuration profile for your tests using the Maven Surefire plug-in.

Prerequisites

  • You have a Quarkus project created with Apache Maven.

Procedure

  • Edit the following example to meet your testing requirements, where <profile_name> is a name for your test profile:

    <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire-plugin.version}</version>
            <configuration>
              <systemPropertyVariables>
                <quarkus.test.profile><profile_name></quarkus.test.profile>
                <buildDirectory>${project.build.directory}</buildDirectory>
                [...]
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>
Note

You cannot use a custom test configuration profile in native mode. Native tests always run using the prod profile.