Skip to content

sothach/stratum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stratum

Stratum test server

Status

Build Status Coverage Status Codacy Badge

Stubbing 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.

Running locally

Run the server on a local system, with source change monitoring / automatic restarting

% sbt ~run

Sample usage

POST translation request

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

GET speech request

http://localhost/api/speech?apiKey=eabb12404d141ed6e8ee2193688178cb&action=convert&text=say%20this&voice=usenglishfemale&format=mp3

Testing

Running the tests

Run the test suite to verify correct behaviour.

From the command line:

% sbt test

Test Coverage Report

To measure test coverage, this app uses the 'scoverage' SBT plugin. To create the report, rom the command line:

% sbt coverage test coverageReport

Author

License

License

(c) 2018 This project is licensed under Creative Commons License

Attribution 4.0 International (CC BY 4.0)