Collection Runner is a Java/Spring Boot "framework" that aims at emulating the "collection runner" feature of Postman.
No GUI is provided, all configuration is done by writing simple Java classes for requests and "scripts".
Is the main class, used for emulating the collection-runner feature. It performs the following steps:
- Execute pre-request scripts
- Build a Request
- Execute the Request
- Verify if the Request should be re-triggered
- Execute post-request scripts
Method chain(CollectionRequest request) is used to chain requests one after the other.
Method run(Long iterations) is used to run the collection n times.
Is the class representing a generic request that CollectionRunner can run:
all requests should extend this basic request implementing its abstract methods.
Two methods worth mentioning:
- preExecutionScript: executes before sending the request
- postExecutionScript: executes after receiving a response
This two methods have access to the surrounding context to set/get variables as needed.
Collection Runner supports the scheduling of recurring tasks using @Scheduled annotation.
For an example, look into ScheduledTask.
Look into CollectionRunnerTest for an example on how to use Collection Runner.
Francesco Cardillo