Stratum test server
This is a simple Play application that exposes a REST API simulating the service provided by ********. The intention is to deploy this server as a drop-in replacement for the real service, allowing integration testing of client application, avoiding the charges and providing canned happy-path and error case responses.
Run the server on a local system, with source change monitoring / automatic restarting
% sbt ~run
curl -X POST -d \
'{"text": "We strongly advise you to keep your luggage with you at all times. Any unattended luggage in the terminal will be removed by the security services and may be destroyed", "language" : "de", "requestType" : "TEXT"}' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
http://localhost:9000/api/translate?apiKey=eabb12404d141ed6e8ee2193688178cb
http://localhost/api/speech?apiKey=eabb12404d141ed6e8ee2193688178cb&action=convert&text=say%20this&voice=usenglishfemale&format=mp3
Run the test suite to verify correct behaviour.
From the command line:
% sbt test
To measure test coverage, this app uses the 'scoverage' SBT plugin. To create the report, rom the command line:
% sbt coverage test coverageReport
(c) 2018 This project is licensed under Creative Commons License