System Reference Data API
Provides system reference data to client applications. Implemented as a Java/SpringBoot application.
To run the project you will need to have the following installed:
- Java 8
- Docker (optional)
For information about the software versions used to build this API and a complete list of it's dependencies see build.gradle
If running locally for development or testing you will need to set the following environment variables
- export POSTGRES_USERNAME=dbrefdata
- export POSTGRES_PASSWORD=dbrefdata
To run the API quickly use the docker helper script as follows:
./bin/run-in-docker.sh
or
docker-compose up
Alternatively, you can start the application from the current source files using Gradle as follows:
./gradlew clean bootRun
If required, to run with a low memory consumption, the following can be used:
./gradlew --no-daemon assemble && java -Xmx384m -jar build/libs/rd-sys-ref-data-api.jar
To understand if the application is working, you can call it's health endpoint:
curl http://localhost:8090/health
If the API is running, you should see this response:
{"status":"UP"}
The application uses a Postgres database which can be run through a docker container on its own if required.
this
The application should automatically apply any database migrations using flyway.
You can run the integration tests as follows:
./gradlew integration
If the API is running (either inside a Docker container or via gradle bootRun
) you can run the functional tests as follows:
./gradlew functional
If you want to run a specific scenario use this command:
./gradlew functional --tests <TestClassName> --info -Dscenario=<Scenario>
If the API is running (either inside a Docker container or via gradle bootRun
) you can run the smoke tests as follows:
./gradlew smoke
If you have some time to spare, you can run the mutation tests as follows:
./gradlew pitest
As the project grows, these tests will take longer and longer to execute but are useful indicators of the quality of the test suite.
More information about mutation testing can be found here: http://pitest.org/