This repository provides an example of a REST API with EvoMaster configured for automated testing.
- Framework: Spring Boot
- Database: Embedded H2
- Requirements: JDK 8, Maven
- Testing: Supports both White-Box and Black-Box testing using EvoMaster
A video tutorial is available on writing an EvoMaster Driver for White-Box Testing.
- Write an EvoMaster driver for the API.
- Download the EvoMaster JAR file.
- Run EvoMaster using the command below:
# Run for 30 seconds and generate tests
java -jar evomaster.jar --maxTime 30s --outputFolder src/test/java/whitebox_tests
# Run for 1 hour, stopping early if no progress is made in 10 minutes
java -jar evomaster.jar --maxTime 1h --prematureStop 10m --outputFolder src/test/java/whitebox_testsBefore running Black-Box testing, ensure the following:
- The target API is running and accessible.
- You have downloaded the EvoMaster JAR.
- The API supports REST, GraphQL, or RPC.
- You have the correct API URL for testing.
- Run EvoMaster with Black-Box mode enabled
java -jar evomaster.jar --bbSwaggerUrl http://localhost:8080/v3/api-docs --blackBox true --maxTime 30s --ratePerMinute 60 --outputFormat JAVA_JUNIT_4 --outputFolder src/test/java/blackbox_tests