Giter Club home page Giter Club logo

hmrc.mdg-stub's Introduction

mdg-stub

Build Status Download

This repository contains stub of the MDG service. It accepts file transfer requests and allows to run and test services relying on integration with MDG (e.g. file-transmission)

Functionality

The service accepts file transfer a format supported by MDG.

The service has one endpoint: http://localhost:9576/mdg-stub/request which accepts POST requests with file transfers.

The format accepted by MDG is specified as a XML Schema in the following file: mdg-schema.xml.

Sample request document can be found here.

In case the request is valid it immediately returns 204. In case the request is invalid it return HTTP 400 error. The mock also allows to simulate erroneous behaviour of MDG. If properly prepared request is sent (see Mocking errors section), HTTP 500 error is returned.

Mocking errors

The mock allows to simulate errors returned by MDG. This can be done in two ways:

Specifying filename with desired error code

If the request refers to the file with a name that matches the pattern failXXX.YYY, where XXX is a desired HTTP status and YYY is any file extension, the stub will immediately return with XXX status.

Defining more complex failure scenarios by defining custom properties

TODO MDG stub allows to specify more complex interaction patterns by adding 'AVAILABILITY' properties. This needs to be documented

Running the service

The service can be run locally either directly or using service manager.

To run service locally you have to execute the following command:

sbt run

To run service using service manager you have to execute the following command:

sm --start MDG_STUB

In both cases the service will be accepting requests on the endpoint http://localhost:9576/mdg-stub/request

Related projects, useful links:

License

This code is open source software licensed under the Apache 2.0 License

hmrc.mdg-stub's People

Contributors

cjwebb avatar cybersaurus avatar dabd avatar hmrc-web-operations avatar luatec avatar nigelhp avatar swathimadhuri avatar tomasz-rosiek avatar

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.