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

--clean

false

Perform a clean build before running tests.

--native

false

Run tests in native mode using GraalVM Native Image.

--verbose or -v

false

Include verbose output.

--help or -h

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:

  • ./gradlew test (Linux/macOS with wrapper)

  • gradle test (Linux/macOS without wrapper)

  • gradlew.bat test (Windows with wrapper)

  • gradle test (Windows without wrapper)

For native tests:

  • ./gradlew nativeTest (Linux/macOS with wrapper)

  • gradle nativeTest (Linux/macOS without wrapper)

  • gradlew.bat nativeTest (Windows with wrapper)

  • gradle nativeTest (Windows without wrapper)

Maven

For JVM tests:

  • ./mvnw test (Linux/macOS with wrapper)

  • mvn test (Linux/macOS without wrapper)

  • mvnw.cmd test (Windows with wrapper)

  • mvn test (Windows without wrapper)

  • mvnd test (Using Maven Daemon)

For native tests:

  • ./mvnw test -Pnative (Linux/macOS with wrapper)

  • mvn test -Pnative (Linux/macOS without wrapper)

  • mvnw.cmd test -Pnative (Windows with wrapper)

  • mvn test -Pnative (Windows without wrapper)

  • mvnd test -Pnative (Using Maven Daemon)

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.