arconia test
The arconia test command runs tests for your Spring Boot application. It delegates to your build tool’s (Maven/Gradle) test tasks with support for both JVM and native modes.
When using the Arconia Framework with Arconia Dev Services, any declared external services are automatically provisioned as containers during the test run. No test configuration classes or @Import annotations needed.
Usage
Basic usage:
arconia test
Clean build before running tests:
arconia test --clean
Run tests in native mode:
arconia test --native
Pass extra parameters to the underlying build tool using --:
arconia test -- --stacktrace
arconia test -- -DmyProperty=value
Options
The following options are available:
| Option | Default | Description |
|---|---|---|
|
|
Perform a clean build before running tests. |
|
|
Run tests in native mode using GraalVM Native Image. |
|
|
Include verbose output. |
|
Display help information for the command. |
The --native option requires GraalVM with the Native Image component installed. Native tests compile the application to a native binary before executing, which takes significantly longer than JVM tests.
|
Build Tool Integration
The test command automatically detects whether your project uses Maven or Gradle and runs the appropriate test task:
| Build Tool | Command |
|---|---|
Gradle |
For JVM tests:
For native tests:
|
Maven |
For JVM tests:
For native tests:
|
Use -- to pass parameters directly to the underlying build tool. The -- separator is required to distinguish Arconia CLI options from build tool parameters.
To run a specific test class or filter tests, use -- to pass the appropriate build tool argument. For example, with Gradle: arconia test — --tests "*BookServiceTests". With Maven: arconia test — -Dtest=BookServiceTests.
|
Integration Testing with Arconia Dev Services
If your project uses Arconia Dev Services, the declared external services are automatically started before your integration tests run and stopped after they complete. No boilerplate configuration is required:
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class BookServiceTests {
@Autowired
BookService bookService;
@Test
void getBooks() {
// The PostgreSQL Dev Service is already running, configured, and ready to use
assertThat(bookService.findAll()).isEmpty();
}
}
This works because Arconia Dev Services detect the test context and provision the required services automatically, the same way they work in development mode with arconia dev.