Immigration & Asylum Bail case API
Immigration & Asylum case API is a Spring Boot based application for Legal Representatives to manage bail applications.
To run the project you will need to have the following installed:
- Java 17
- Docker (optional)
For information about the software versions used to build this API and a complete list of it's dependencies see build.gradle
To run the API quickly use the docker helper script as follows: (make sure to have the required environment variables set as under functional tests section)
./bin/run-in-docker.sh --clean --install
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/ia-bail-case-*.jar
To understand if the application is working, you can call it's health endpoint:
curl http://localhost:8686/health
If the API is running, you should see this response:
{"status":"UP"}
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 the API is running (either inside a Docker container or via gradle bootRun
) you can run the smoke tests as follows:
./gradlew smoke
You can run contract or pact tests as follows:
./gradlew contract
You can then publish your pact tests locally by first running the pact docker-compose:
docker-compose -f docker-pactbroker-compose.yml up
and then using it to publish your tests:
./gradlew pactPublish
- Make sure your git version is at least 2.9 using the
git --version
command - Run the following command:
git config --local core.hooksPath .git-config/hooks
Once the above is done, you will be required to follow specific conventions for your commit messages and branch names.
If you violate a convention, the git error message will report clearly the convention you should follow and provide additional information where necessary.
Optional:
-
Install this plugin in Chrome: https://github.com/refined-github/refined-github
It will automatically set the title for new PRs according to the first commit message, so you won't have to change it manually.
Note that it will also alter other behaviours in GitHub. Hopefully these will also be improvements to you.
In case of problems
-
Get in touch with your Technical Lead and inform them, so they can adjust the git hooks accordingly
-
Instruct IntelliJ not to use Git Hooks for that commit or use git's
--no-verify
option if you are using the command-line -
If the rare eventuality that the above is not possible, you can disable enforcement of conventions using the following command
git config --local --unset core.hooksPath
Still, you shouldn't be doing it so make sure you get in touch with a Technical Lead soon afterwards.