Skip to content

Latest commit

 

History

History
175 lines (107 loc) · 8.56 KB

README.md

File metadata and controls

175 lines (107 loc) · 8.56 KB

Mock Data Holder (Java)

Overview

The Mock Data Holder (Java) is a reference implementation of a CDR Data Holder solution, designed to support the Consumer Data Right (CDR) implementation journey. It aims to assist CDR participants in developing their own Data Holder (DH) systems that comply with Consumer Data Standards.

Using the Mock Data Holder

The Data Standards Body provides a docker image in the DockerHub. You can run the image on your computer to get a running instance of the Mock Data Holder (Java) without the need for a local setup. For more information, refer to the Quick Start with Docker section below.

You can also set up a local instance of this project for customised and extended use cases. For more information, refer to the Local Setup and Customisation section below.

To interact with and explore CDR APIs of the Mock Data Holder, you can use our comprehensive Postman collection. Please refer to the Using Postman to call the Data holder APIs section below for details.

This solution:

  • is maintained regularly to ensure compatibility with the latest Consumer Data Standards.
  • assists Data Holders with regulatory adherence through accurate request and response simulations.
  • provides Docker Support to simplify deployment and testing across various environments, with ready-to-use Docker images available on DockerHub, eliminating the need for local builds.
  • provides ORM (JPA) support with H2 database to demonstrate an end-to-end API endpoint implementation.
  • strictly follows the CDS Guidelines for handling the request and response HTTP headers accurately.
  • utilises test data generated by the Test Data CLI Tool for populating the database to mimic various real-world scenarios for thorough testing.

Quick Start with Docker

  1. Run the image from DockerHub:

    docker run -p 8383:8383 consumerdatastandardsaustralia/mock-data-holder-java:x.x.x
    

    or, if you want to point to your own keystore:

    docker run -p 8383:8383 -v /your/local/path/to/mock-data-holder-java/keystore:/keystore consumerdatastandardsaustralia/mock-data-holder-java:x.x.x
    
  2. If you want to pass a test data file to be loaded at start up:

    docker run -p 8383:8383 -v /your/local/path/to/testdata-cli/samples/output/u1-output.json:/testdata/u1-output.json consumerdatastandardsaustralia/mock-data-holder-java:x.x.x file:///testdata/u1-output.json
    

    or

    docker run -p 8383:8383 -v /your/local/path/to/testdata-cli/samples/output/u1-output.json:/testdata/u1-output.json consumerdatastandardsaustralia/mock-data-holder-java:x.x.x https://some.web.server/testdata/u1-output.json
    

    Where x.x.x is the version, say, 2.6.0

  3. Run locally-built image:

    docker run -p 8383:8383 consumerdatastandardsaustralia/mock-data-holder-java:2.6.1-SNAPSHOT
    

Local Setup and Customisation

Prerequisites

Before you begin, ensure you have the following installed:

  • Git, for cloning the repository.
  • Java 8 (JDK 1.8)
  • Maven 3

Installation

  1. Create a fork of this repository. To do this, click the Fork button in the top right corner of the GitHub repository home page.

  2. After forking the repository, clone it to your local machine. You can do this by running the following command in your terminal or command prompt:

    git clone https://github.com/your-username/project-name.git

    Replace your-username with your GitHub username and project-name with the name of your repository.

  3. Once the repository is cloned, navigate to the project directory by running:

    cd project-name
    

    Replace project-name with the name of the repository.

Build

  1. Customise the project as needed for your specific use case.
  2. Navigate to the project directory and execute the following command:
mvn install

Run

  1. Start the development server by running the following command in the project directory:

    mvn spring-boot:run

    or

    java -jar target/mock-data-holder-java-x.x.x.jar
    

    Where x.x.x is the version, say, 2.6.0

    The data will be loaded from the payloads directory.

    If you want to pass a test data file to be loaded at start up:

    java -jar target/mock-data-holder-java-x.x.x.jar /your/local/path/to/testdata-cli/samples/output/u1-output.json
    
  2. Open your web browser and navigate to http://localhost:8383 to access the Mock Data Holder (Java) application. You should be able to see the Swagger UI page.

Contribution Process

We welcome contributions from the community! If you'd like to contribute to this project, please follow these simple steps:

  1. Create a new branch for your work from the master branch:

    git checkout -b feature/your-feature-name
    
  2. Begin making your changes or contributions.

  3. Follow the instructions in the project repository to run and test your changes locally.

  4. Commit your changes with clear and concise commit messages.

  5. Push your changes to your forked repository.

  6. Open a pull request (PR) using the dev branch in the original repository as the destination branch. Include a detailed description of your changes and the problem you are addressing.

  7. Engage in the discussion on your PR and make any necessary adjustments based on feedback from maintainers and other contributors.

  8. Once your PR is approved and all tests pass, it will be merged into the project.

Note:

  1. Please ensure your contributions align with our project's objectives and guidelines.

Using Postman to call the Data holder APIs

Our Postman collection includes pre-configured environments and requests that mirror typical interactions with our Mock Data Holder's APIs, and allows us to test functionality, response formats, and error handling seamlessly.

Detailed Documentation and Guides

For comprehensive guides, installation instructions, usage tutorials, and more, please visit this article on Zendesk.

Reporting Issues

Encountered an issue? We're here to help. Please visit our issue reporting guidelines for submitting an issue.

Stay Updated

Join our newsletter to receive the latest updates, release notes, and alerts. Subscribe here.

License

The artefact is released under the MIT License, which allows the community to use and modify it freely.

Disclaimer

The artefacts in this repository are offered without warranty or liability, in accordance with the MIT licence.

The Data Standards Body (DSB) develops these artefacts in the course of its work, in order to perform quality assurance on the Australian Consumer Data Right Standards (Data Standards).

The DSB makes this repository, and its artefacts, public on a non-commercial basis in the interest of supporting the participants in the CDR ecosystem.

The resources of the DSB are primarily directed towards assisting the Data Standards Chair for developing the Data Standards.

Consequently, the development work provided on the artefacts in this repository is on a best-effort basis, and the DSB acknowledges the use of these tools alone is not sufficient for, nor should they be relied upon with respect to accreditation, conformance, or compliance purposes.