/eori-common-component-frontend

Primary LanguageScalaApache License 2.0Apache-2.0

EORI Common Component Frontend

Frontend application for the the ECC (EORI Common Component) Subscription service. This service handles EORI Subscription journey.

Other related ECC services:

Development

This service is written in Scala and Play, and requires Java 11 JRE to run.

To develop or run service locally you'll also need:

Service Manager Commands

What's running?

sm2 -s

Start the required development services (make sure your service-manager-config folder is up to date)

sm2 --start EORI_COMMON_COMPONENT_ALL

Stop all ECC related services

sm2 --stop EORI_COMMON_COMPONENT_ALL

Running locally

When running locally the start page can be accessed via Government Gateway login stub http://localhost:9949/auth-login-stub/gg-sign-in.

To start the journey redirect URL has to point to http://localhost:6750/customs-enrolment-services/cds/subscribe after all required service-manager services are started.

All pages in the flow are authentication protected.

To run EORI Common Component Frontend using default port number

sbt run

Debugging

Before debugging locally you will need to stop the Service Manager-started eori-common-component-frontend service

sm2 --stop EORI_COMMON_COMPONENT_FRONTEND

Then start your local debugging session on the expected port

sbt -jvm-debug 9999 run

And finally connect and set-up debugger; Intellij set-up example

Debbuger Setup

Testing

We're using ScalaTest for Unit and Integration tests.

You can run unit test suite with

sbt test

To run integration test suit execute

sbt it:test

To run all test suites together with Scoverage and ScalaFMT code formatting execute script

./precheck.sh

We're using Scoverage to check the code coverage of our test suites.

You can run this on the command line with

sbt clean coverage test it:test coverageReport

Adjust the following in build.sbt to configure Scoverage

...
ScoverageKeys.coverageMinimum := 80,
ScoverageKeys.coverageFailOnMinimum := false,
...

Architecture and Flows

High level journey diagram with APIs involved is documented in Confluence.

Different journeys and scenarios can be triggered using documented scenarios.

License

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