lorca-gestionale-be/testSuite/fullRegisterCinematic/0b_newtest_list_all.sh

22 lines
802 B
Bash

TOKEN=$(curl -s -X POST http://localhost:8080/api/auth/login \
-H "Content-Type: application/json" \
-d '{"username":"newtest","password":"cGFzc3dvcmQ="}' | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')
curl -X GET http://localhost:8080/api/workers \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
# UNCOMMENT BELOW TO REGISTER USER
#
#curl -X POST http://localhost:8080/api/workers/register \
# -H "Authorization: Bearer $TOKEN" \
# -H "Content-Type: application/json" \
# -d '{"name": "TestTest","surname": "TestTest","dni": "12345678B","dateOfBirth": "1990-05-15","email": "example@domain.org","category":"FISIO"}'
#
#
#curl -X GET http://localhost:8080/api/workers \
# -H "Authorization: Bearer $TOKEN" \
# -H "Content-Type: application/json"