The purpose of this microservice is to allow users to register their business for VAT online.
To start all the dependent services required by VAT Registration Frontend in service manager, you can either use sm --start VAT_REG_ALL -r or sm2 --start VAT_REG_ALL -r if you are using sm2.
Alternatively, if you want to start the service individually, you can either use sm --start VAT_REG_FE -r or sm2 --start VAT_REG_FE -r if you are using sm2.
Prior to starting the service locally, make sure the instance running in service manager is stopped. This can be done by running either sm --stop VAT_REG_FE, or sm2 --stop VAT_REG_FE if you are using sm2.
The below instructions are for Mac/Linux only. Windows users will have to use SBT to run the service on port
9895.
- Clone this repository into the development environment on your machine.
- Open a terminal and navigate to the folder you cloned the service into.
- Run either
./run.shorsbt run -Dapplication.router=testOnlyDoNotUseInAppConf.Routesto start the service locally on port9895and enable the/test-onlyroutes for local testing. - Ensure all dependent services are started, using the
VAT_REG_ALLservice manager profile.
Individual journeys are not supported by VAT Registration.
- In a browser, navigate to the Auth Login Stub on
http://localhost:9949/auth-login-stub/gg-sign-in - Enter the following information:
- Redirect URL:
http://localhost:9895/register-for-vat - Affinity group:
Organisation
- Redirect URL:
- Click
Submitto start the journey.
- In a browser, navigate to the Auth Login Stub on
http://localhost:9949/auth-login-stub/gg-sign-in - Enter the following information:
- Redirect URL:
http://localhost:9895/register-for-vat - Affinity group:
Agent - Enrolments (at the bottom of the page):
- Enrolment Key:
HMRC-AS-AGENT - Identifier name:
AgentReferenceNumber - Identifier value: enter anything
- Status:
Activated
- Enrolment Key:
- Redirect URL:
- Click
Submitto start the journey. - During the journey, you will be asked if you want to register for yourself or someone else. Select
Somone else'sand providing you are logged in asAgentaffinity group and have theHMRC-AS-AGENTenrolment, you will proceed with the agent journey. If you selectYour owninstead, the non-agent journey will apply.
The service calls out to various services throughout the journey which have been stubbed. To set the feature switches, navigate to http://localhost:9895/register-for-vat/test-only/feature-switches.
Note: These pages set feature switches using system properties, which are local to the specific JVM the service is running on. If you are testing in an environment that provisions multiple instances (e.g. QA/Staging), you will need to either submit the feature switch page several times to ensure all instances are hit, or, alternatively, set the feature switches in config as JVM arguments and re-deploy the service.
To view the json payload from a submission, on the final Check Your Answers page before selecting Confirm and submit to submit the application, navigate to http://localhost:9895/register-for-vat/test-only/submission-payload.
To run the unit and integration tests, you can either use sbt test it/test or sbt clean coverage test it/test scalastyle coverageReport or ./run-all-tests.sh
To run the accessibility tests, use sbt A11y/test.
You will need to have Node.js and npm installed to run the accessibility tests.
Documentation of TEST endpoints
This code is open source software licensed under the Apache 2.0 License