Giter Club home page Giter Club logo

hmc-cft-hearing-service's Introduction

hmc-cft-hearing-service

Getting Started

Please note that this microservice is also available within hmc-docker.

Prerequisites

Building and deploying the application

Building the application

The project uses Gradle 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:

  ./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 Bus

See 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:

./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:

  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:

  ./gradlew assemble

Create docker image:

  docker-compose build

Run the distribution (created in build/install/hmc-cft-hearing-service directory) by executing the following command:

  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:

  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:

  ./gradlew test

Integration tests

To run all integration tests execute the following command:

  ./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. To run all local checks execute the following command:

  ./gradlew check

License

This project is licensed under the MIT License - see the LICENSE file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.