Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hmcts/am-org-role-mapping-service
https://github.com/hmcts/am-org-role-mapping-service
jenkins-cft jenkins-cft-a-c
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/hmcts/am-org-role-mapping-service
- Owner: hmcts
- License: mit
- Created: 2020-06-15T13:31:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T11:46:15.000Z (about 2 months ago)
- Last Synced: 2024-10-29T12:18:54.117Z (about 2 months ago)
- Topics: jenkins-cft, jenkins-cft-a-c
- Language: Java
- Size: 9.36 MB
- Stars: 1
- Watchers: 7
- Forks: 2
- Open Issues: 49
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# am-org-role-mapping-service
[![API Docs](https://img.shields.io/badge/API%20Docs-site-e140ad.svg)](https://hmcts.github.io/cnp-api-docs/swagger.html?url=https://hmcts.github.io/cnp-api-docs/specs/am-org-role-mapping-service.json)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=am-org-role-mapping-service&metric=alert_status)](https://sonarcloud.io/summary/overall?id=am-org-role-mapping-service)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=am-org-role-mapping-service&metric=security_rating)](https://sonarcloud.io/summary/overall?id=am-org-role-mapping-service)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=am-org-role-mapping-service&metric=vulnerabilities)](https://sonarcloud.io/summary/overall?id=am-org-role-mapping-service)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=am-org-role-mapping-service&metric=sqale_rating)](https://sonarcloud.io/summary/overall?id=am-org-role-mapping-service)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=am-org-role-mapping-service&metric=coverage)](https://sonarcloud.io/summary/overall?id=am-org-role-mapping-service)Organisation Role Mapping Service
## Purpose
It provisions various organisation roles for staff & judicial users based on the service specific mapping rules. It is implemented as a Java/SpringBoot application.
### Prerequisites
To run the project you will need to have the following installed:
* Java 11
* DockerFor information about the software versions used to build this API and a complete list of it's dependencies see build.gradle
### Running the application
To run the API quickly use the docker helper script as follows:
```
./bin/run-in-docker.sh install
```
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-case-worker-api.jar
```### Using the application
To understand if the application is working, you can call it's health endpoint:
```
curl http://localhost:4098/health
```If the API is running, you should see response like below:
```
{"status":"UP"}
```### DB Initialisation˙
The application uses a Postgres database which can be run through a docker container on its own if required.
The application should automatically apply any database migrations using flyway.### Running unit tests tests:
If you have some time to spare, you can run the *unit tests* as follows:
```
./gradlew test
```### Running integration tests:
You can run the *integration tests* as follows:
```
./gradlew integration
```### Running functional tests:
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 --info -Dscenario=
```### Running smoke tests:
If the API is running (either inside a Docker container or via `gradle bootRun`) you can run the *smoke tests* as follows:
```
./gradlew smoke
```### Running mutation tests tests:
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/### Testing in Postman
To test in Postman the easiest way is to start this service using the ./bin/run-in-docker.sh script. The in postman paste the following script:
```
pm.sendRequest('http://127.0.0.1:4098/token', function (err, res) {
if (err) {
console.log(err);
} else {
pm.environment.set("token", res.text());
}
});
```
into the pre-script window. Also add a header as follows:```
ServiceAuthorization: Bearer {{token}}
```Authorization : Bearer copy IDAM access token
### Contract testing with pact
Please refer to the confluence on how to run and publish PACT tests.
https://tools.hmcts.net/confluence/display/RTRD/PACT+testing