Skip to content
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
07d9937
Move away from jcenter, apply plugins in the plugin block and fix uni…
Michael1142 Mar 27, 2025
babaece
Update deprecated property
Michael1142 Mar 27, 2025
443c651
Move project metadata properties into the application block
Michael1142 Mar 27, 2025
6fe138a
Update report generation syntax
Michael1142 Mar 27, 2025
1bbeb75
Update main to mainClass for bootRunAat task
Michael1142 Mar 27, 2025
ab22b03
Remove force property
Michael1142 Mar 27, 2025
95e82e9
Fix indentation
Michael1142 Mar 27, 2025
073ae3a
Update main to mainClass
Michael1142 Mar 27, 2025
2e33613
Update gradle wrapper to 8.13
Michael1142 Mar 27, 2025
dad658b
Update report location for checkstyle
Michael1142 Mar 27, 2025
cde63e1
Remove unused pmd config
Michael1142 Mar 27, 2025
a5b03bc
Externalise checkstyle and owasp dependency check configuration to th…
Michael1142 Mar 27, 2025
3967f3b
Fix white space
Michael1142 Mar 27, 2025
741b3f8
Update github workflow to use java 17
Michael1142 Mar 27, 2025
cdb6a74
Remove checkstyle config
Michael1142 Mar 27, 2025
56e435f
Remove checkstyle dependency
Michael1142 Mar 27, 2025
f988bfb
Optimise imports
Michael1142 Mar 27, 2025
747c4ff
Remove whitespace
Michael1142 Mar 27, 2025
f309aeb
Refactor code to fix checkstyle violations
Michael1142 Mar 27, 2025
8d1b463
Update suppressions
Michael1142 Mar 27, 2025
d0c46c4
Add path to suppressions
Michael1142 Mar 27, 2025
ccc88f0
Update launch darkley config to remove deprecated methods
Michael1142 Mar 28, 2025
eddbe52
Remove dependabot
Michael1142 Mar 31, 2025
a7bd3ff
Remove unused configs
Michael1142 Mar 31, 2025
3e2fe99
Remove unneeded cast
Michael1142 Apr 1, 2025
8c7fff5
Fix sonar issues, improve logging and fix typo
Michael1142 Apr 1, 2025
16c7148
Fix typo in method name
Michael1142 Apr 1, 2025
636055f
fix typo in method name
Michael1142 Apr 1, 2025
5136054
Fix sonar issues
Michael1142 Apr 1, 2025
be5a852
Fix typo in method name
Michael1142 Apr 1, 2025
eaf3c23
Update readme to use heading tags not emphasis for headings
Michael1142 Apr 1, 2025
8ff20e8
Update method to use javas built in utf8 encoding
Michael1142 Apr 1, 2025
2745e80
Update tests to use junit 5
Michael1142 Apr 1, 2025
5239a23
Remove serenity and pitest, and bump dependencies
Michael1142 Apr 1, 2025
c73432c
Fix indentation
Michael1142 Apr 1, 2025
0bdeb76
Set sourcesets programatically
Michael1142 Apr 1, 2025
e00b350
Fix warning
Michael1142 Apr 1, 2025
ddb80ed
Bump dependencies
Michael1142 Apr 1, 2025
c68d012
Remove pitest from sonar
Michael1142 Apr 1, 2025
19971ad
Reorder pact config to fix pact tests
Michael1142 Apr 1, 2025
7acab79
Update suppressions
Michael1142 Apr 1, 2025
b97bd16
Fix sonar xml output location
Michael1142 Apr 1, 2025
3f60c71
Update suppressions
Michael1142 Apr 1, 2025
92601ae
Move junit version to versions block
Michael1142 Apr 1, 2025
feaabc2
Bump chart java version
Michael1142 Apr 1, 2025
dc7a278
Merge branch 'master' into fix-dependency-check
Michael1142 Apr 2, 2025
362da4d
Update readme
Michael1142 Apr 2, 2025
20f02f4
Move pacts to the contractTests resources folder
Michael1142 Apr 2, 2025
5761435
Tidy pact tasks and update tasks to use new gradle syntax
Michael1142 Apr 2, 2025
a2bfd2a
Add jitpack
Michael1142 Apr 2, 2025
2692d12
Update pact encoding
Michael1142 Apr 2, 2025
382c1b0
Add jitpack
Michael1142 Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Template CI
name: Java CI

on:
pull_request:
Expand All @@ -14,10 +14,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: '17'
- name: Build
run: ./gradlew check
72 changes: 28 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Document Generator
# Private Law Document Generator

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/hmcts/prl-dgs-api.svg?branch=master)](https://travis-ci.org/hmcts/prl-dgs-api)
[![codecov](https://codecov.io/gh/hmcts/prl-dgs-api/branch/master/graph/badge.svg)](https://app.codecov.io/gh/hmcts/prl-dgs-api)
[![Documentation](https://img.shields.io/static/v1?label=Documentation&message=DGS&color=informational&logo=confluence)](https://tools.hmcts.net/confluence/display/PL/PDF+document+generator)

This is a document generation and template management service. This allows to generate documents based on a
Expand All @@ -12,31 +10,28 @@ Document Management Store (via Case Document AM).
The service provides a single RESTful endpoint that will generate the document, store it in Evidence Management
Store and return the link to the stored data.

Updated with master code base until 2.1
## Dynamic file name

### Dynamic file name
You must pass **dynamic_fileName** key in the **placeholders** map to get a dynamic file name
You must pass `dynamic_fileName` key in the `placeholders` map to get a dynamic file name

### Setup
## Setup

**Prerequisites**
### Prerequisites

- [JDK 17](https://openjdk.java.net/)
- [Docker](https://www.docker.com)

### Building

***Building***

The project uses [Gradle](https://gradle.org) as a build tool but you don't have to install it locally since there is a
`./gradlew` wrapper script.
The project uses [Gradle](https://gradle.org) as a build tool.

To build project please execute the following command:

```bash
./gradlew build
```

**Running**
### Running

First you need to create distribution by executing following command:

Expand All @@ -56,7 +51,7 @@ After it has finished downloaded run:
az login
```

This should open a browser window for you to login, use your HMCTS account
This should open a browser window for you to log in, use your HMCTS account

After logging in run the following command:

Expand All @@ -74,76 +69,65 @@ docker-compose up
```

As a result the following container(s) will get created and started:
- long living container for API application exposing port `4007`

- long living container for API application exposing port `4007`

#### Troubleshooting

### Managing Preview environment PODs
Make sure you have added the label 'enable_keep_helm' while creating the PR. Otherwise, add the label and re-trigger the build.

Make sure you have added the label `enable_keep_helm` while creating the PR. Otherwise, add the label and re-trigger the build.

## Testing

**Integration tests**
### Integration tests

To run all integration tests locally:

* Make a copy of `src/main/resources/example-application-aat.yml` as `src/main/resources/application-aat.yml`
* Make a copy of `src/integrationTest/resources/example-application-local.properties` as `src/integrationTest/resources/application-local.properties`
* Replace the `replace_me` secrets in the _newly created_ files. You can get the values from SCM and Azure secrets key vault (the new files are in .gitignore and should ***not*** be committed to git)
* Assuming you use IntelliJ, run your application
* And then run your gradle functional tests task
* Or if using command line:
* Start the app with AAT config using `./gradlew clean bootRunAat`
* Start the test with AAT config using `./gradlew clean functional`
- Make a copy of `src/main/resources/example-application-aat.yml` as `src/main/resources/application-aat.yml`
- Make a copy of `src/integrationTest/resources/example-application-local.properties` as `src/integrationTest/resources/application-local.properties`
- Replace the `replace_me` secrets in the _newly created_ files. You can get the values from SCM and Azure secrets key vault (the new files are in .gitignore and should _**not**_ be committed to git)
- Assuming you use IntelliJ, run your application
- And then run your gradle functional tests task
- Or if using command line:
- Start the app with AAT config using `./gradlew clean bootRunAat`
- Start the test with AAT config using `./gradlew clean functional`

If you update content in [templates](https://github.com/hmcts/rdo-docmosis-templates), you can re-generate the PDFs by running the ignored test `PDFGenerationTest.ignoreMe_updateGeneratedPdfs`. The test
will output generated PDFs to the folder `src/integrationTest/resources/documentgenerator/documents/regenerated`

**Unit tests**
### Unit tests

To run all unit tests please execute following command:

```bash
./gradlew test
```

**Coding style tests**
### Coding style tests

To run all checks (including unit tests) please execute following command:

```bash
./gradlew check
```

**Mutation tests**

To run all mutation tests execute the following command:

```bash
./gradlew pitest
```

## Developing

**Flow Diagram**
### Flow Diagram

![diagram](docs/DataFlow.png)

**API documentation**
### API documentation

API documentation is provided with Swagger:
- `http://localhost:4007/swagger-ui.html` - UI to interact with the API resources

**Versioning**
- `http://localhost:4007/swagger-ui.html` - UI to interact with the API resources

We use [SemVer](http://semver.org/) for versioning.
For the versions available, see the tags on this repository.

**Standard API**
### Standard API

We follow [RESTful API standards](https://hmcts.github.io/restful-api-standards/).

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

Loading