The gambling-external-stub provides stubs for downstream services used by gambling-related backend services. It is used to simulate external dependencies for local development and integration testing.
This module includes a stub for the RDS-Cache-repository service used by downstream data cache proxy integrations.
Service Manager:
sm2 --start GAMBLING_ALL
To start the server locally:
sbt run
Base URL:
http://localhost:10405/rds-datacache-proxy
Run unit tests:
sbt test
Run integration tests:
sbt it/test
Check code coverage:
sbt clean coverage test it/test coverageReport
GET
/mgd/{mgdRegNumber}
Full URL:
http://localhost:10405/rds-datacache-proxy/mgd/{mgdRegNumber}
Controller mapping:
uk.gov.hmrc.gamblingexternalstub.controllers.rdsDataCacheProxy.MgdController.getReturnSummary(mgdRegNumber: String)
Request:
GET http://localhost:10405/rds-datacache-proxy/mgd/GAM0000000001
Response:
200 OK
{
"mgdRegNumber": "GAM0000000001",
"returnsDue": 0,
"returnsOverdue": 1
}Request:
GET http://localhost:10405/rds-datacache-proxy/mgd/GAM0000000002
Response:
200 OK
{
"mgdRegNumber": "GAM0000000002",
"returnsDue": 0,
"returnsOverdue": 0
}Request:
GET http://localhost:10405/rds-datacache-proxy/mgd/invalid
Response:
400 BAD_REQUEST
{
"code": "INVALID_MGD_REG_NUMBER",
"message": "mgdRegNumber must be provided"
}Request:
GET http://localhost:10405/rds-datacache-proxy/mgd/error
Response:
500 INTERNAL_SERVER_ERROR
{
"code": "UNEXPECTED_ERROR",
"message": "Unexpected error occurred"
}- No authentication required
- No database
- No service layer
- Deterministic responses only
- Errors are simulated using special path values (
invalid,error) - Used for local/dev/testing only
app/
├── controllers/
│ └── rdsDataCacheProxy/
│ └── GamblingController.scala
├── models/
│ └── ReturnSummary.scala
curl http://localhost:10405/rds-datacache-proxy/mgd/GAM0000000001
curl http://localhost:10405/rds-datacache-proxy/mgd/invalid
curl http://localhost:10405/rds-datacache-proxy/mgd/error
GET
/mgd/{mgdRegNumber}/certificate
Full URL:
http://localhost:10405/rds-datacache-proxy/mgd/{mgdRegNumber}/certificate
Controller mapping:
uk.gov.hmrc.gamblingexternalstub.controllers.rdsDataCacheProxy.GamblingController.getMgdCertificate(mgdRegNumber: String)
Request:
GET /mgd/GAM0000000001/certificate
Response:
200 OK
{
"mgdRegNumber": "GAM0000000001",
"registrationDate": "2023-01-15",
"businessName": "Acme Gaming Ltd",
"typeOfBusiness": "Corporate Body",
"noOfPartners": 2,
"groupReg": "Y",
"noOfGroupMems": 1,
"dateCertIssued": "2024-02-01"
}Request:
GET /mgd/GAM0000000002/certificate
Response:
200 OK
{
"mgdRegNumber": "GAM0000000002",
"registrationDate": "2022-10-05",
"businessName": "Example Sole Trader",
"typeOfBusiness": "Sole proprietor",
"noOfPartners": 0,
"groupReg": "N",
"noOfGroupMems": 0,
"dateCertIssued": "2024-01-10"
}Request:
GET /mgd/{anyOtherReg}/certificate
Response:
200 OK
- Returns a generic payload
- No partners or group members
Request:
GET /mgd/invalid/certificate
Response:
400 BAD_REQUEST
{
"code": "INVALID_MGD_REG_NUMBER",
"message": "mgdRegNumber must be provided"
}Request:
GET /mgd/error/certificate
Response:
500 INTERNAL_SERVER_ERROR
{
"code": "UNEXPECTED_ERROR",
"message": "Unexpected error occurred"
}This project is licensed under the Apache 2.0 License.