Skip to content

Commit

Permalink
Added Postman tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evt committed Sep 27, 2020
1 parent 0b4b99f commit 8dc4985
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 9 deletions.
15 changes: 10 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/env.cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ export GOOGLE_APPLICATION_CREDENTIALS=./serviceaccount.json

# Google Cloud Postgres
export PG_PROTO=unix
export PG_ADDR=/cloudsql/wakeup-290812:europe-west1:wakeup-postgres/.s.PGSQL.5432
export PG_ADDR=/cloudsql/helical-arcade-290815:europe-west1:wakeup/.s.PGSQL.5432
export PG_DB=wakeup
export PG_USER=wakeup
export PG_PASSWORD=wakeup

export GC_PROJECT=wakeup-290812
export GC_PROJECT=helical-arcade-290815
export GC_PROJECT_LOCATION=europe-west1

export CALL_ROOM_ENDPOINT=https://$GC_PROJECT_LOCATION-$GC_PROJECT.cloudfunctions.net/CallRoom
Expand Down
2 changes: 1 addition & 1 deletion cmd/env.local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export PG_DB=wakeup
export PG_USER=postgres
export PG_PASSWORD=postgres

export GC_PROJECT=wakeup-290812
export GC_PROJECT=helical-arcade-290815
export GC_PROJECT_LOCATION=europe-west1

export CALL_ROOM_ENDPOINT=https://$GC_PROJECT_LOCATION-$GC_PROJECT.cloudfunctions.net/CallRoom
Expand Down
12 changes: 12 additions & 0 deletions cmd/serviceaccount.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "helical-arcade-290815",
"private_key_id": "85b4fae73c92321a8bc3fe79b7ac17951ca01968",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC1ICIVeyzBSksr\nmSVm0k8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5/IwdAU5nm3Uwn1oVWlkjGmTFDncUPYJWASqAI\n97PCLTqWfK7LqSA7t7Z8+sfAxoEfkaR9BuWW6BuoKyWm0KcFVZ0RxBRsEK70PJv2\nEYAc+Sl2ZBmbFC5GFJN99L9QWFBThKiTLtEzzYOghr8FyI1cjWf/6FeD0QKBgFRu\nIy0mxN+v9rkripL+NYegqnNZhVxqLY6515fRWaG2jrRDoajgfPCsXMggwRPNfZ7B\n5QElwxIzZ7+HqijTE4+vkeWqJNZ4eyUiEoRtGVDuEefBfHLdwwTEzUnR4nhJX2xi\nPj0fx6K2TVkngrl8FFY1pZm/Lb35gPW+6mAH5WvhAoGBANFM46oBt4u3N8xNyeGT\nVNmjTTPYTA3vzCwCS1KB090ZP69LF6nMfz/pPSpR9Um8wG/beMp6/yht62+mM1Xx\n7OmwQ8NYSd8x/whvQpuFViQ+eHBUFfhefpPSsfQgwVkNvV+th88bV5Zj6fqUEA+/\n8N/k0U9SS3xRs6PI5NIcIRRg\n-----END PRIVATE KEY-----\n",
"client_email": "wakeup-web-service@helical-arcade-290815.iam.gserviceaccount.com",
"client_id": "105402040463382550092",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/wakeup-web-service%40helical-arcade-290815.iam.gserviceaccount.com"
}
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type Config struct {
SchedulerMaxRetryCount int `env:"SCHEDULER_MAX_RETRY_COUNT"`
SchedulerRetryPeriod string `env:"SCHEDULER_RETRY_PERIOD"`
CallEndpoint string `env:"CALL_ENDPOINT"`

}

var (
Expand Down
54 changes: 54 additions & 0 deletions postman/WakeUp.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"info": {
"_postman_id": "6c219dcf-8b98-4119-9794-6ddf65c7186c",
"name": "WakeUp",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
},
"item": [
{
"name": "localhost:8080/callroom?wakeup_time=10:00",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://europe-west1-wakeup-278716.cloudfunctions.net/CallRoom?call_time=20:05",
"protocol": "https",
"host": [
"europe-west1-wakeup-278716",
"cloudfunctions",
"net"
],
"path": [
"CallRoom"
],
"query": [
{
"key": "call_time",
"value": "20:05"
}
]
}
},
"response": []
},
{
"name": "localhost:8080/wakeup",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "[\n\t{\n\t\t\"firstname\": \"Barak\",\n\t\t\"lastname\": \"Obama\",\n\t\t\"call_time\": \"09:00\",\n\t\t\"room_number\": 9\n\t},\n\t{\n\t\t\"firstname\": \"Vladimir\",\n\t\t\"lastname\": \"Putin\",\n\t\t\"call_time\": \"06:00\",\n\t\t\"room_number\": 1\n\t}\n]",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "https://europe-west1-wakeup-286404.cloudfunctions.net/ScheduleCall"
},
"response": []
}
],
"protocolProfileBehavior": {}
}

0 comments on commit 8dc4985

Please sign in to comment.