This is a quick training about how to use simulacron.
Simulacron is a native protocol server simulator that helps facilitate the testing of scenarios that are difficult to reliably reproduce in driver clients and applications.
A PDF document is included here with an introduction to Simulacron.
To run the application it is required Java 17
and docker/docker-compose
, then just need to generate the jar and start the docker compose
./gradlew build && docker-compose up -d
Docker compose will build a docker image for the spring application, a build is required to generate the jar.
-d
is used for detached mode.
This Simulacron training contains functional tests for create book endpoint as first implementation.
As exercise, implement the following scenarios:
GET /books
- Validate a 500 response status code when Cassandra times out to query all the books on database
- Validate a 500 response status code when Cassandra has unavailable nodes querying all
GET /books/{id}
- Validate a 500 response status code when Cassandra times out to query by id on database
- Validate a 500 response status code when Cassandra has unavailable nodes querying by id
PUT /books/{id}
- Validate a 500 response status code when Cassandra times out to query by id on database
- Validate a 500 response status code when Cassandra has unavailable nodes querying by id
- Validate a 500 response status code when Cassandra times out to insert books on database
- Validate a 500 response status code when Cassandra has unavailable nodes on insert
DELETE /books/{id}
- Validate a 500 response status code when Cassandra times out to query by id on database
- Validate a 500 response status code when Cassandra has unavailable nodes querying by id
- Validate a 500 response status code when Cassandra times out to delete books on database
- Validate a 500 response status code when Cassandra has unavailable nodes on delete
Exercises resolution are available on the branch simulacron-tests