Added curl to service-reporting
authorFabian Eichhorner <fabian.eichhorner@gmail.com>
Wed, 12 Dec 2018 22:22:15 +0000 (23:22 +0100)
committerFabian Eichhorner <fabian.eichhorner@gmail.com>
Wed, 12 Dec 2018 22:22:15 +0000 (23:22 +0100)
service-reporting/README.md

index 49640ff5533c2410012dd38bf6f42f4d2a7463fc..527651f0e548b3943b48d4d5bee40b830e9b0fa6 100644 (file)
@@ -41,4 +41,10 @@ Term(string `Name`, double `Sentiment`)
 - .net core 2.2
 - download [libwkhtml library](https://github.com/rdvojmoc/DinkToPdf/tree/master/v0.12.4) depending on your operating system and put it into `service-reporting` root folder
 ### commands
-- `dotnet run`
\ No newline at end of file
+- `dotnet run`
+
+## Tests
+- successfull pdf as application/json: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] '`
+- successfull pdf as application/base64: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Accept: application/base64' \ -H 'Content-Type: application/json' \ -d '[ { "name": "A bad term", "sentiment": 0.1 }, { "name": "Another bad term", "sentiment": 0.3 }, { "name": "A neutral term", "sentiment": 0.5 }, { "name": "A good term", "sentiment": 0.65 }, { "name": "Another good term", "sentiment": 0.9 } ] '`
+- invalid sentiment value: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name": "Term with invalid sentiment value", "sentiment": 12 } ] '`
+- invalid json structure: `curl -X POST \ http://localhost:8083/generatePDF \ -H 'Content-Type: application/json' \ -d '[ { "name1": "A term with invalid json format", "sentiment": 0.5 } ] '`
\ No newline at end of file