Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmcts/hmc-cft-hearing-service
https://github.com/hmcts/hmc-cft-hearing-service
jenkins-cft jenkins-cft-d-i
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/hmcts/hmc-cft-hearing-service
- Owner: hmcts
- License: mit
- Created: 2021-09-29T09:06:36.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T10:06:58.000Z (about 2 months ago)
- Last Synced: 2024-10-29T12:11:58.117Z (about 2 months ago)
- Topics: jenkins-cft, jenkins-cft-d-i
- Language: Java
- Size: 6.12 MB
- Stars: 1
- Watchers: 16
- Forks: 2
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# hmc-cft-hearing-service
## Getting Started
Please note that this microservice is also available within [hmc-docker](https://github.com/hmcts/hmc-docker).### Prerequisites
- [JDK 21](https://java.com)
- [Docker](https://www.docker.com)## Building and deploying the application
### Building the application
The project uses [Gradle](https://gradle.org) as a build tool. It already contains
`./gradlew` wrapper script, so there's no need to install gradle.To build the project execute the following command:
```bash
./gradlew build
```### Running the application
The easiest way to run the application locally is to use the `bootWithCCD` Gradle task.
This task requires:
- Access to the `hmc-demo` key vault
- Two queues on the `hmc-servicesbus-demo` Azure Service Bus
- One topic on the `hmc-servicebus-demo` Azure Service BusSee [Creating Azure Service Bus Resources](https://tools.hmcts.net/confluence/display/HMAN/Creating+Azure+Service+Bus+Resources) for detailed instructions on creating ASB resources.
**Set required environment variables**
The following environment variables need to be set for the created Azure Service Bus resources:
| Environment Variable | Description |
|----------------------|-------------|
| HMC_OUTBOUND_SERVICE_BUS_QUEUE | Outbound queue name |
| HMC_SERVICE_BUS_QUEUE | Inbound queue name |
| HMC_SERVICE_BUS_TOPIC | Topic name for publishing updates |**Run the application**
Run the application by executing the following command:
```bash
./gradlew bootWithCCD
```This will start the application and its dependent services.
In order to test if the application is up, you can call its health endpoint:
```bash
curl http://localhost:4561/health
```You should get a response similar to this:
```
{"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}
```### Alternative to running the application
Create the image of the application by executing the following command:
```bash
./gradlew assemble
```Create docker image:
```bash
docker-compose build
```Run the distribution (created in `build/install/hmc-cft-hearing-service` directory)
by executing the following command:```bash
docker-compose up
```This will start the API container exposing the application's port
(set to `4561` in this template app).In order to test if the application is up, you can call its health endpoint:
```bash
curl http://localhost:4561/health
```You should get a response similar to this:
```
{"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}
```## Developing
### Unit tests
To run all unit tests execute the following command:
```bash
./gradlew test
```### Integration tests
To run all integration tests execute the following command:
```bash
./gradlew integration
```
### Running contract or pact tests:You can run and publish your pact tests locally by first running the pact docker-compose:
```
docker-compose -f docker-pactbroker-compose.yml up
```And then using gradle task:
```
./gradlew runAndPublishConsumerPactTests
```
Run below command for the provider pact verification:```
./gradlew clean runProviderPactVerification
```Alternatively you can run single command for both consumer tests and provider verifications
```
./gradlew clean contract
```
### Code quality checks
We use [Checkstyle](http://checkstyle.sourceforge.net/).
To run all local checks execute the following command:```bash
./gradlew check
```
## LicenseThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details