The TestConfiguration class provides centralized configuration for test execution, credential management, Maven repository settings, and application properties. All configuration is done through system properties.
Property constants
Product configuration
The product type to test (e.g., CAMEL_QUARKUS, CAMEL_SPRINGBOOT)
Credentials and vault
Path to the credentials file
Direct credentials configuration
test.credentials.vault.token
Vault authentication token
test.credentials.vault.secret.id
Vault secret ID for AppRole authentication
test.credentials.vault.role.id
Vault role ID for AppRole authentication
test.credentials.vault.address
string
default:"https://vault.devshift.net"
Vault server address
test.credentials.vault.path.pattern
Pattern for constructing Vault secret paths
Application configuration
Maven group ID for the test application
test.app.version
string
default:"1.0.0-SNAPSHOT"
Version of the test application
Directory where the application is located or will be built
Name of the application template
Enable remote debugging for the application
Port for remote debugging
Test execution
Wait time in seconds for test operations
Timeout in minutes before forcefully killing test processes
Skip cleanup after test execution
test.skip.teardown.openshift.amqstreams
Skip cleanup of AMQ Streams resources on OpenShift
Enable parallel test execution
test.use.global.openshift.kafka
Use a global Kafka instance on OpenShift instead of per-test instances
Enable streaming logs during test execution
Maven configuration
Maven repository URL. Supports mirror syntax with @mirrorOf=
Custom Maven settings XML content
test.maven.settings.file.name
string
default:"tnb-maven-settings.xml"
Name of the generated Maven settings file
test.maven.repository.id
string
default:"tnb-maven-repo"
ID for the Maven repository
Additional arguments to pass to Maven commands
test.maven.transfer.progress
Show Maven artifact transfer progress
Path to the odo CLI binary. Auto-detected from system PATH if not specified
Integrations
test.report.portal.enabled
Enable ReportPortal integration for test reporting
Comma-separated list of allowed JIRA issue resolutions
JIRA access token for authentication
User configuration
Username for TNB operations. Defaults to system username if not “hudson”
Kamelets
Version of Kamelets to use
Public methods
Product and version
public static ProductType product()
Returns the configured product type from test.product property.
Vault methods
public static String vaultToken()
public static String vaultRoleId()
public static String vaultSecretId()
public static String vaultPathPattern()
public static String vaultAddress()
Retrieve Vault authentication and configuration details.
Credentials methods
public static String credentialsFile()
public static String credentials()
Access credential configuration.
Application methods
public static String appGroupId()
public static String appVersion()
public static Path appLocation()
public static String appTemplateName()
public static boolean appDebug()
public static Integer appDebugPort()
Retrieve application configuration values.
Test execution methods
public static Duration testWaitTime()
public static Duration testWaitKillTimeout()
public static boolean skipTearDown()
public static boolean skipTearDownOpenshiftAMQStreams()
public static boolean parallel()
public static boolean streamLogs()
public static boolean useGlobalOpenshiftKafka()
Control test execution behavior.
Maven methods
public static String mavenRepository()
public static String mavenSettings()
public static String mavenExtraArgs()
public static String mavenSettingsFileName()
public static String mavenRepositoryId()
public static boolean mavenTransferProgress()
public static boolean isMavenMirror()
Access Maven configuration. The isMavenMirror() method checks if the repository URL contains @mirrorOf=.
Integration methods
public static boolean reportPortalEnabled()
public static Set<String> jiraAllowedResolutions()
public static String jiraAccessToken()
Configure external integrations.
Utility methods
public static String user()
public static String odoPath()
public static String kameletsVersion()
Retrieve user, tool paths, and component versions.
Usage examples
Basic test configuration
mvn test \
-Dtest.product=CAMEL_QUARKUS \
-Dtest.app.group.id=com.example \
-Dtest.app.version=2.0.0
Maven repository configuration
mvn test \
-Dtest.maven.repository=https://repository.example.com/maven2 \
-Dtest.maven.repository.id=custom-repo \
-Dtest.maven.extra.args="-U -X"
Vault credentials
mvn test \
-Dtest.credentials.vault.address=https://vault.example.com \
-Dtest.credentials.vault.token=hvs.CAESIJ... \
-Dtest.credentials.vault.path.pattern=/secret/data/tnb/
Debug mode
mvn test \
-Dtnb.app.debug=true \
-Dtnb.app.debug.port=5005
When running in debug mode, the test application will wait for a debugger to attach on the specified port before proceeding.
Parallel execution with namespace isolation
mvn test \
-Dtest.parallel=true \
-Dtest.use.openshift=true
When parallel mode is enabled, namespaces will automatically get a random suffix to avoid conflicts.
Access in Java code
import software.tnb.common.config.TestConfiguration;
import software.tnb.common.product.ProductType;
public class MyTest {
@Test
public void testConfiguration() {
ProductType product = TestConfiguration.product();
String groupId = TestConfiguration.appGroupId();
Duration waitTime = TestConfiguration.testWaitTime();
if (TestConfiguration.appDebug()) {
System.out.println("Debug port: " + TestConfiguration.appDebugPort());
}
}
}