This application allows us to receive contribution and subscription events from Google.
sbt runThis will start the Play server in devmode.
You can then check the application is running by hitting
Local: http://localhost:9233/healthcheck
Prod: https://swg.theguardian.com/healthcheck
The application has a POST endpoint that receives JSON from the Google Cloud PubSub queue.
This can be tested by running the spoofer with an instance of ElasticMQ.
http://localhost:5000/ has a console that you can submit messages to the queue and you can see them ingested in the app.
This application ships with sbt plugins: scalastyle, scapegoat, scoverage.
We aim to be warning free, warts free and sustain a high level of branch coverage. Although we don't strive to have a high test coverage, we use the reports to identify areas of untested code.
Reports can be generated by running the command
sbt scalastyle scapegoat coverge test coverageReportCoverage report location: <repo-home>/target/scala-2.12/scoverage-report/index.html
Scapegoat report location: <repo-home>/target/scala-2.12/scapegoat-report/scapegoat.html
Scalastyle report location: <repo-home>/target/scalastyle-result.xml
A long living refresh token is stored in AWS Param Store under /$app/$stage/google/playDeveloperRefreshToken. This token can be re-generated with the following steps.
This token is used by the application to generate shorter living access tokens used to talk with Google APIs. GoogleAccessTokenClient caches these access tokens with the expiry time returned by the API.