Вы можете добавить свойства в свои тесты, настроив плагин surefire
, например:
...
<groupId>use-surefire</groupId>
<artifactId>use-surefire</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<environment>${env}</environment>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<systemPropertyVariables>
<environment>${environment}</environment>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>