Testing

June 24, 2026 · View on GitHub

Overview

MockServer uses a multi-layered testing strategy spanning unit tests, integration tests, packaging verification tests, container integration tests, and performance tests. Tests are predominantly written in JUnit 4 with a small number of JUnit 5 tests in the mockserver-junit-jupiter module.

graph TB
    subgraph "Unit Tests (Surefire)"
        UT["*Test.java — ~251 files"]
    end
    subgraph "Integration Tests (Failsafe)"
        IT["*IntegrationTest.java — ~184 files"]
    end
    subgraph "Packaging Integration Tests"
        MI["Maven Invoker — 3 sub-builds"]
        GI["Gradle — 2 sub-builds"]
    end
    subgraph "Container Integration Tests"
        DC["Docker Compose — 16 tests"]
        HT["Helm/k3d — 8 tests"]
    end
    subgraph "Performance Tests"
        PT["k6"]
    end
    UT --> IT --> MI & GI --> DC & HT --> PT

Test Frameworks and Dependencies

FrameworkVersionUsage
JUnit 44.13.2Primary test framework across almost all modules
JUnit Jupiter (JUnit 5)5.14.4Used exclusively in mockserver-junit-jupiter
Mockito Core5.23.0Mocking framework used in most modules
Mockito JUnit Jupiter5.23.0JUnit 5 Mockito integration (mockserver-junit-jupiter only)
Hamcrest3.0Assertion matchers used across all modules
JSONAssert1.5.3JSON assertion library (mockserver-core)
Spring Test5.3.39mockserver-core, mockserver-war, mockserver-proxy-war, mockserver-spring-test-listener, mockserver-examples
XMLUnit2.11.0XML comparison (production dependency, also supports test assertions)

No TestNG is used anywhere in the project.

Test Inventory by Module

ModuleUnit TestsIntegration TestsTotal Test FilesDescription
mockserver-core~220~62~282Largest suite: matchers, serialization, validators, actions, collections, auth, logging
mockserver-netty~13~64~77Server lifecycle, TLS, proxy, CORS, authenticated control plane
mockserver-examples0~25~25End-to-end examples with various HTTP clients
mockserver-junit-jupiter~6~12~18JUnit 5 extension tests (injection, parallel safety, settings)
mockserver-junit-rule~4~4~8JUnit 4 Rule/ClassRule tests
mockserver-war0~8~8WAR deployment integration tests (embedded Tomcat)
mockserver-client-java~5~2~7Client API unit tests, event bus, serialization
mockserver-spring-test-listener~2~4~6Spring TestExecutionListener tests
mockserver-proxy-war0~3~3Proxy WAR integration tests (embedded Tomcat)
mockserver-testing101Self-test for the Assert utility class
mockserver-integration-testing000No tests of its own — it IS the shared test infrastructure
Total~251~184~435

Test Architecture

Naming Convention

Test filtering is done entirely by naming convention — no @Category or @Tag annotations are used:

PatternRunnerMaven PhasePlugin
**/*Test.javaSurefiretestmaven-surefire-plugin 3.5.6
**/*IntegrationTest.javaFailsafeintegration-test / verifymaven-failsafe-plugin 3.5.6

Abstract Base Class Hierarchy

The project uses a template method pattern for integration tests. Abstract base classes in mockserver-integration-testing define hundreds of test cases, and concrete classes in each module provide the server wiring.

classDiagram
    class AbstractMockingIntegrationTestBase {
        <<abstract>>
        #MockServerClient mockServerClient
        #EchoServer insecureEchoServer
        #EchoServer secureEchoServer
        #NettyHttpClient httpClient
        +beforeClass()
        +afterClass()
    }

    class AbstractBasicMockingIntegrationTest {
        <<abstract>>
        +shouldReturnResponseByMatchingPath()
        +shouldReturnResponseByMatchingMethod()
        ...~50 test methods
    }

    class AbstractExtendedMockingIntegrationTest {
        <<abstract>>
        +shouldForwardRequestInHTTPS()
        +shouldCallbackToSpecifiedClass()
        ...~123 test methods
    }

    class AbstractExtendedSameJVMMockingIntegrationTest {
        <<abstract>>
        +shouldCallbackToSpecifiedObject()
        ...same-JVM callback tests
    }

    class AbstractProxyIntegrationTest {
        <<abstract>>
        +shouldForwardRequestsUsingSocketDirectly()
        ...proxy test methods
    }

    AbstractMockingIntegrationTestBase <|-- AbstractBasicMockingIntegrationTest
    AbstractBasicMockingIntegrationTest <|-- AbstractBasicMockingSameJVMIntegrationTest
    AbstractBasicMockingSameJVMIntegrationTest <|-- AbstractExtendedMockingIntegrationTest
    AbstractExtendedMockingIntegrationTest <|-- AbstractExtendedSameJVMMockingIntegrationTest
    AbstractMockingIntegrationTestBase <|-- AbstractProxyIntegrationTest

    class AbstractBasicMockingSameJVMIntegrationTest {
        <<abstract>>
        Basic tests for same-JVM scenarios
    }

    class ClientAndServerMockingIntegrationTest {
        +startServer()
        Concrete: starts Netty server
    }
    class AbstractExtendedDeployableWARMockingIntegrationTest {
        <<abstract>>
        Intermediate: WAR deployment setup
    }
    class ExtendedWARMockingIntegrationTest {
        +startServer()
        Concrete: deploys to embedded Tomcat
    }
    class JUnitClassRuleIntegrationTest {
        +startServer()
        Concrete: uses JUnit 4 ClassRule
    }

    AbstractBasicMockingSameJVMIntegrationTest <|-- ClientAndServerMockingIntegrationTest
    AbstractExtendedSameJVMMockingIntegrationTest <|-- AbstractExtendedDeployableWARMockingIntegrationTest
    AbstractExtendedDeployableWARMockingIntegrationTest <|-- ExtendedWARMockingIntegrationTest
    AbstractBasicMockingSameJVMIntegrationTest <|-- JUnitClassRuleIntegrationTest

This architecture means a single abstract test class change can affect tests across multiple modules. The mockserver-integration-testing module has no tests of its own — it exists solely to provide these shared base classes.

Assertion Patterns

Many tests use private helper methods or abstract base classes for assertions. Assertions are present but not always visible in the @Test method body. For example:

  • AuthenticatedControlPlaneUsing*IntegrationTest classes delegate assertions to clientOperationIsAuthenticated() (uses assertThrows + assertThat) and httpAPIOperationIsAuthenticated() (asserts HTTP 401 + error message)
  • ConcurrencyBasicResponseMockingIntegrationTest runs assertions inside scheduled tasks via sendRequestAndVerifyResponse() which calls Assert.assertEquals
  • NettyHttpProxySOCKSIntegrationTest delegates to helpers like proxyRequestsUsingSocketViaSOCKS5() containing multiple assertions

Precanned Callbacks

The mockserver-integration-testing module provides precanned callback implementations in org.mockserver.testing.integration.callback:

ClassPurpose
PrecannedTestExpectationForwardCallbackRequestForward callback with request override
PrecannedTestExpectationForwardCallbackRequestAndResponseForward callback with request and response override
PrecannedTestExpectationResponseCallbackResponse callback returning precanned response

Unit Tests

Unit tests use JUnit 4 (or JUnit 5 in mockserver-junit-jupiter) and run via the Maven Surefire plugin during the test phase.

PropertyValue
Naming convention*Test.java
Excludes*IntegrationTest.java
Maven phasetest
Pluginmaven-surefire-plugin 3.5.6
Log levelmockserver.logLevel=${mockserver.testLogLevel} (default: ERROR)
Localeen-GB (-Duser.language=en -Duser.country=GB)
Test listenerorg.mockserver.test.PrintOutCurrentTestRunListener
XML reportsControlled by ${disableXmlReport} (default: true)
Forked process timeout1800 seconds
Fork countDefault (1 fork per module; forkCount=0 commented out for debugging)

Running Unit Tests

./mvnw test

./mvnw test -pl mockserver-core

./mvnw test -pl mockserver-netty -Dtest=MockServerRuleTest

Integration Tests

Integration tests use JUnit 4 and run via the Maven Failsafe plugin during the integration-test and verify phases. They start real servers (Netty, embedded Tomcat) and exercise full request/response flows.

PropertyValue
Naming convention*IntegrationTest.java
Maven phaseintegration-test / verify
Pluginmaven-failsafe-plugin 3.5.6
Log levelmockserver.logLevel=${mockserver.testLogLevel} (default: ERROR)
Extra system propertiesproject.version, project.basedir
Localeen-GB
Test listenerorg.mockserver.test.PrintOutCurrentTestRunListener
XML reportsControlled by ${disableXmlReport} (default: true)
Forked process timeout1800 seconds

Running Integration Tests

./mvnw verify

./mvnw verify -pl mockserver-netty

Integration Test Infrastructure

The mockserver-integration-testing module provides shared abstract test base classes:

ClassPurpose
AbstractMockingIntegrationTestBaseBase class with common setup/teardown (MockServerClient, EchoServer, NettyHttpClient)
AbstractBasicMockingIntegrationTestBasic mocking test cases (~50 methods)
AbstractExtendedMockingIntegrationTestExtended mocking with all action types (~123 methods)
AbstractExtendedSameJVMMockingIntegrationTestSame-JVM callback testing
AbstractBasicMockingSameJVMIntegrationTestBasic tests for same-JVM scenarios
AbstractProxyIntegrationTestProxy mode integration tests

Embedded Server Infrastructure

Integration tests use real embedded servers rather than mocks:

ServerModulePurpose
EchoServer (Netty)mockserver-coreReturns request details as response body (secure + insecure instances)
Embedded Tomcat 9.0.xmockserver-war, mockserver-proxy-warWAR deployment testing
MockServer (Netty)mockserver-nettyFull server lifecycle testing

Downstream Dependency Integration Tests

mockserver/mockserver-netty/src/integration-tests/ contains Maven Invoker and Gradle-based tests that verify the published mockserver-netty artifacts work correctly when consumed by a downstream project:

DirectoryPurpose
maven-netty-jar-with-dependencies-dependency/Tests the :jar-with-dependencies classifier as a Maven dependency
maven-netty-no-dependencies-dependency/Tests mockserver-netty-no-dependencies as a Maven dependency
gradle-netty-no-dependencies-dependencies/Tests mockserver-netty-no-dependencies from Gradle

These are run by maven-invoker-plugin (Maven variants, parallelThreads=2) and exec-maven-plugin calling gradle_integration_tests.sh (Gradle variant) during the integration-test/install phases. The legacy maven-netty-shaded-dependency and gradle-netty-shaded-dependencies directories were removed in 6.0.0 along with the <classifier>shaded</classifier> artifact form.

Container Integration Tests

Located in container_integration_tests/, these tests verify MockServer behaviour when running as a Docker container or Kubernetes pod. These are NOT run in CI — they are only invoked by local_quick_build.sh and local_online_build.sh. Estimated runtime is ~5-10 minutes (with pre-built JAR).

Running Container Integration Tests

container_integration_tests/integration_tests.sh

SKIP_HELM_TESTS=true container_integration_tests/integration_tests.sh

SKIP_JAVA_BUILD=true SKIP_DOCKER_BUILD_MOCKSERVER=true container_integration_tests/integration_tests.sh

Environment Variable Controls

VariableDefaultPurpose
SKIP_JAVA_BUILDunsetSkip mvnw package step
SKIP_DOCKER_BUILD_MOCKSERVERunsetSkip building MockServer Docker image
SKIP_DOCKER_REBUILD_CLIENTunsetSkip rebuilding the curl client image
SKIP_ALL_TESTSunsetSkip all tests (build only)
SKIP_DOCKER_TESTSunsetSkip Docker Compose tests
SKIP_HELM_TESTSunsetSkip Helm/k3d tests

Docker Compose Tests (16)

Each test has its own directory containing a docker-compose.yml and integration_test.sh:

TestValidates
docker_compose_forward_with_overrideForward with request/response override
docker_compose_remote_host_and_port_by_environment_variableRemote host/port via MOCKSERVER_PROXY_REMOTE_HOST/PORT
docker_compose_server_port_by_commandServer port via command-line argument
docker_compose_server_port_by_environment_variable_long_nameServer port via MOCKSERVER_SERVER_PORT
docker_compose_server_port_by_environment_variable_short_nameServer port via SERVER_PORT
docker_compose_without_server_portDefault port (1080)
docker_compose_with_expectation_initialiserExpectation initialiser class
docker_compose_with_persisted_expectationsPersisted expectations file
docker_compose_with_server_port_from_default_properties_filePort from mockserver.properties
docker_compose_with_server_port_from_custom_properties_filePort from custom properties file
docker_compose_with_mtlsMutual TLS (mTLS) client certificate verification
docker_compose_jvm_optionsCustom JVM options via JAVA_OPTS
docker_compose_libs_classpathAdditional JARs on the /libs classpath
docker_compose_graceful_shutdownGraceful shutdown on SIGTERM
docker_compose_metricsPrometheus metrics endpoint
docker_compose_war_tomcatWAR deployment on Tomcat

Helm Tests (8)

Helm tests use k3d (k3s in Docker) to create a local cluster:

TestValidates
helm_default_configDefault Helm chart values
helm_local_docker_containerLocal Docker image loaded into k3d
helm_custom_server_portCustom server port via Helm values
helm_remote_host_and_portRemote host/port via Helm values
helm_inline_configInline config via Helm values (app.config.enabled, app.config.initializerJson)
helm_configmap_injectionExternal config via ConfigMap
helm_mockserver_config_chartStandalone MockServer config Helm chart
helm_clustered_convergenceClustered state convergence (Infinispan, non-blocking)

Helper Scripts

ScriptPurpose
integration_tests.shMain orchestrator: builds Docker image, runs all tests, prints summary
docker-compose.shDocker Compose helper functions (start-up, tear-down, docker-exec, container-logs)
helm-deploy.shk3d cluster lifecycle (start-up-k8s, tear-down-k8s), Helm install/uninstall
logging.shColoured terminal output, runCommand, retryCommand, logTestResult

Test Flow

sequenceDiagram
    participant R as integration_tests.sh
    participant D as Docker
    participant T as integration_test.sh

    R->>R: Source logging.sh, helm-deploy.sh, docker-compose.sh
    R->>D: Build MockServer image (mockserver/mockserver:integration_testing)
    R->>D: Build curl client image

    loop For each Docker Compose test
        R->>T: cd test_dir && ./integration_test.sh
        T->>D: docker-compose -p $TEST_CASE up -d
        T->>D: docker-exec client "curl ..." (create expectation)
        T->>D: docker-exec client "curl ..." (verify behaviour)
        T->>R: logTestResult $? $TEST_CASE
        T->>D: docker-compose -p $TEST_CASE down
    end

    R->>R: Start k3d cluster
    loop For each Helm test
        R->>T: cd test_dir && ./integration_test.sh
        T->>D: helm install ... && kubectl wait ...
        T->>D: kubectl exec client -- curl ...
        T->>R: logTestResult $? $TEST_CASE
        T->>D: helm uninstall
    end
    R->>R: Tear down k3d cluster

    R->>R: Print PASSED/FAILED summary

Docker Image Variant Coverage

There are 6 production Docker image variants. Only the main nonroot variant is tested:

VariantDockerfileBase ImageTested?
Main (nonroot)docker/Dockerfiledistroless/java17:nonrootYES (built as integration_testing image)
GraalJSdocker/graaljs/Dockerfiledistroless/java17:nonrootNO
Rootdocker/root/Dockerfiledistroless/java17NO
Snapshot (debug)docker/snapshot/Dockerfiledistroless/java17:debug-nonrootNO
Root Snapshotdocker/root-snapshot/Dockerfiledistroless/java17NO
Local builddocker/local/Dockerfiledistroless/java17:nonrootNO

The integration tests always build with --build-arg source=copy (local JAR). The default source=download mode (downloads from Sonatype) used by real users is never tested.

What Docker Features Are Tested

  • Basic container startup and HTTP API responsiveness
  • Environment variable handling (MOCKSERVER_SERVER_PORT, SERVER_PORT, PROXY_REMOTE_HOST, PROXY_REMOTE_PORT, MOCKSERVER_LOG_LEVEL, MOCKSERVER_INITIALIZATION_JSON_PATH, MOCKSERVER_PROPERTY_FILE, MOCKSERVER_PERSIST_EXPECTATIONS, MOCKSERVER_PERSISTED_EXPECTATIONS_PATH)
  • Volume mounts for configuration files and persisted state
  • Command-line argument passing (-serverPort)
  • Multi-container networking (bridge network between client and server)
  • HTTP/2 support (via nghttp in the forward-with-override test)

What Docker Features Are NOT Tested

FeatureStatus
Health checksNo HEALTHCHECK instruction in any Dockerfile. MOCKSERVER_LIVENESS_HTTP_GET_PATH exists but is disabled by default.
Graceful shutdown (signal handling)No test verifies docker stop drains connections or persists state.
Multi-arch (ARM64)CI builds linux/amd64,linux/arm64 but integration tests only run on native arch.
JVM options (JVM_OPTIONS env var)Supported by Helm chart but never tested via Docker Compose.
/libs/* classpath extensionEntrypoint includes /libs/* on classpath for custom JARs but no test mounts into /libs/.
Custom TLS certificatesForward-with-override uses HTTPS via nghttp but no test exercises custom certs or mTLS.
Resource limits / memory constraintsNo test verifies behaviour under memory pressure.

What Helm Features Are Tested

The 5 Helm tests cover basic deployment, custom image tags, custom server port, inline configuration, and inter-service proxy forwarding. All use the same validation pattern: create expectation via PUT, verify response via GET.

What Helm Features Are NOT Tested

FeatureIn Chart?Tested?
Ingress (ingress.yaml, 52 lines)YESNO
Service types (ClusterIP, LoadBalancer)YESNO (only NodePort)
Resource limitsYESNO
ConfigMap (app.config.enabled)YESNO
Probes (readiness/liveness)YES (hardcoded)Implicit only (via --wait)
Affinity / tolerations / node selectorsYESNO
Pod annotations / security contextYESNO
Replica count >1YESNO
helm test hook (service-test.yaml)YESNO (never invoked)
helm lint / helm templateN/ANO (not run anywhere)
mockserver-config chartYES (separate chart)NO (zero tests)
mountedLibsConfigMapNameYESNO

Performance Tests

The docker_build/performance/Dockerfile provides a k6-based performance testing image built on grafana/k6. The scenarios (smoke / load / stress / soak) and their threshold gates live in mockserver-performance-test/k6/; CI lints them on every change and runs an opt-in load test on manual/scheduled builds.

Test Utilities

mockserver-testing Module

Shared test utilities available to all modules:

ClassPurpose
PrintOutCurrentTestRunListenerJUnit RunListener that prints STARTED/FINISHED/FAILED/IGNORED with timing
AssertCustom assertion helpers: assertContains, assertDoesNotContain, assertSameEntries
RetriesRetry logic for flaky/async operations: tryWaitForSuccess(runnable, maxAttempts, interval)
TempFileWriterTemporary file creation for tests
IsDebugDetects if running under a debugger; adjusts timeout units (seconds vs. minutes)

PrintOutCurrentTestRunListener

Configured globally via Surefire/Failsafe in the root pom.xml:

<properties>
    <listener>org.mockserver.test.PrintOutCurrentTestRunListener</listener>
</properties>

Supports three output modes controlled by -Dmockserver.testOutput:

ModeDefaultBehaviour
verboseYes (local)Prints STARTED: and FINISHED: with duration for every test
quietCIPrints dots (.) for pass, F for failures, S for skipped, with per-class summaries
summaryNoPrints per-class pass/fail counts with failure details only

Test Configuration

Surefire Configuration (Root pom.xml)

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
        <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
        <includes>
            <include>**/*Test.java</include>
        </includes>
        <excludes>
            <exclude>**/*IntegrationTest.java</exclude>
        </excludes>
        <systemPropertyVariables>
            <mockserver.logLevel>${mockserver.testLogLevel}</mockserver.logLevel>
        </systemPropertyVariables>
        <argLine>@{argLine} -Duser.language=en -Duser.country=GB
                 -Dmockserver.testOutput=${mockserver.testOutput}
                 ${mockserver.testArgLine}</argLine>
        <disableXmlReport>${disableXmlReport}</disableXmlReport>
        <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
        <properties>
            <property>
                <name>listener</name>
                <value>org.mockserver.test.PrintOutCurrentTestRunListener</value>
            </property>
        </properties>
    </configuration>
</plugin>

Failsafe Configuration (Root pom.xml)

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>${maven-surefire-plugin.version}</version>
    <configuration>
        <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
        <includes>
            <include>**/*IntegrationTest.java</include>
        </includes>
        <systemPropertyVariables>
            <mockserver.logLevel>${mockserver.testLogLevel}</mockserver.logLevel>
            <project.version>${project.version}</project.version>
            <project.basedir>${project.basedir}</project.basedir>
        </systemPropertyVariables>
        <argLine>@{argLine} -Duser.language=en -Duser.country=GB
                 -Dmockserver.testOutput=${mockserver.testOutput}
                 ${mockserver.testArgLine}</argLine>
        <disableXmlReport>${disableXmlReport}</disableXmlReport>
        <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
        <properties>
            <property>
                <name>listener</name>
                <value>org.mockserver.test.PrintOutCurrentTestRunListener</value>
            </property>
        </properties>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Parallelization

LevelMechanismCILocal
Module-levelMaven -T flag-T 1C (1 thread/core)-T 3C (3 threads/core)
Maven Invoker tests<parallelThreads>2 threads2 threads
mockserver-core unit testsTwo-phase Surefire: phase 1 parallel=classes/threadCount=4; phase 2 sequential4 threads (phase 1)4 threads (phase 1)
Other modulesDefault (1 fork/module)DefaultDefault

mockserver-core uses a two-phase Surefire configuration: the default execution runs most unit tests in parallel (parallel=classes, threadCount=4), while a second execution (sequential-tests) runs a curated list of state-sensitive or timing-sensitive tests single-threaded. Tests excluded from the parallel phase include MockServerEventLogTest, HttpStateTest, template engine tests, and others that have wall-clock timing assertions or shared static state. All other modules run Surefire with its default (single-threaded) settings.

ProfileActivationPurpose
kill_mockserver_instancesAuto on Unix (/usr/bin/env exists)Kills stray MockServer processes during clean phase via scripts/stop_MockServer.sh

Test Skip Flags

FlagWhere UsedEffect
-DskipTestsVarious scriptsSkips Surefire + Failsafe + Invoker + Gradle tests
-Dmaven.test.skip=truelocal_release.shSkips test compilation and execution
${skipTests}mockserver-netty/pom.xmlControls Invoker (<skipInvocation>) and Gradle tests (<skip>)

Test Data and Fixtures

Test resources are located in src/test/resources/ across modules:

ModuleResource Types
mockserver-coreOpenAPI specs (YAML/JSON), JSON schemas, XML schemas, TLS certificates/keys, initializer JSON files, binary files (PNG)
mockserver-nettyTLS certificates and keys (RSA and EC), CSR configs, initializer JSON
mockserver-warXML schema, Tomcat catalina.properties
mockserver-proxy-warTomcat catalina.properties
mockserver-junit-jupiterMockito mock-maker-inline config
mockserver-integration-testingXML schema

Test Coverage Tooling

JaCoCo (jacoco-maven-plugin) is configured in the parent mockserver/pom.xml with four execution goals:

GoalPhasePurpose
prepare-agentinitializeInstruments classes for unit test coverage
prepare-agent-integrationpre-integration-testInstruments classes for integration test coverage
reportverifyGenerates per-module unit test coverage report
report-integrationverifyGenerates per-module integration test coverage report

Reports are generated in each module's target/site/jacoco/ directory. See AI-Assisted Development for current coverage numbers by module.

Known Issues

Test Anti-Patterns

PatternCountDetails
Mega-test methods (>200 lines)6Largest: shouldHandleInvalidOpenAPIJsonRequest() at 1994 lines in HttpStateTest
Excessive mocking (>100 mocks)2MockServerClientTest (130), HttpActionHandlerTest (109)
TODO comments about missing coverage4NottableStringMultiMapContainAllTest, HttpRequestsPropertiesMatcherTest

CI Test Execution

Buildkite

The scripts/buildkite_quick_build.sh script runs the full build inside a mockserver/mockserver:maven Docker container:

./mvnw -T 1C clean install -Djava.security.egd=file:/dev/./urandom \
  -Dmockserver.testOutput=quiet -DdisableXmlReport=false \
  -DredirectTestOutputToFile=true -Dmockserver.testLogLevel=INFO \
  "-Dmockserver.testArgLine=-Dmockserver.maxLogEntries=10000 -Dmockserver.maxExpectations=5000"
PropertyValue
JVM heap-Xms2048m -Xmx6144m
Maven parallelism-T 1C (1 thread per CPU core)
Test outputquiet (dots + failure details)
XML reportsEnabled (-DdisableXmlReport=false)
Test output redirectionEnabled (-DredirectTestOutputToFile=true)
Test log levelINFO (-Dmockserver.testLogLevel=INFO)
Timeout60 minutes
Build artefacts**/*.log files collected

All tests (unit + integration + Maven Invoker + Gradle integration) run in a single monolithic Buildkite step. There is no separation into different CI jobs for different test types.

Local Development

The scripts/local_quick_build.sh script:

  1. Sets 8GB heap allocation
  2. Uses Java 17 (/usr/libexec/java_home -v 17)
  3. Runs parallel Maven build (-T 3C)
  4. Runs container integration tests with SKIP_JAVA_BUILD=true
./scripts/local_quick_build.sh

./scripts/local_single_test.sh

./scripts/local_single_module.sh