ソースを参照

Merge branch 'test-curl' of cmte/micro-services into master

cmte 3 年 前
コミット
80f970a81a

+ 4 - 0
tests/cmd/auth/createuser.json

@@ -0,0 +1,4 @@
+{
+    "username": "mariamaria",
+    "passwordHash": "123456123456"
+}

+ 12 - 0
tests/cmd/auth/createuser.sh

@@ -0,0 +1,12 @@
+#!/bin/sh
+
+resp1=$(cat createuser.json | curl -s -H "Content-Type: application/json" localhost:8080/signup --data @- | jq .created) 
+z=$(echo $resp1 | grep true)
+test -z $z && exit
+echo User Created: $resp1 | grep true
+
+
+resp2=$(cat createuser.json | curl -s -H "Content-Type: application/json" localhost:8080/login --data @- | jq .authenticated)
+z=$(echo $resp2 | grep true)
+test -z $z && exit
+echo Authenticated: $resp2 | grep true

+ 0 - 0
test.json → tests/cmd/auth/logintest.json


+ 3 - 0
tests/cmd/auth/logintest.sh

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cat logintest.json | curl -H "Content-Type: application/json" localhost:8080/login --data @-