Skip to content

Commit

Permalink
Substitute UID into test URLs to avoid clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Smith committed Nov 1, 2023
1 parent c4ebf8e commit dd2e1a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ test-api: URL ?= http://localhost:9000
test-api:
go build -o ./signer/test-api ./signer && \
chmod +x ./signer/test-api && \
./signer/test-api -expectedStatus=201 PUT $(URL)/lpas/M-AL9A-7EY3-075D '{"version":"1"}' && \
./signer/test-api -expectedStatus=400 PUT $(URL)/lpas/M-AL9A-7EY3-075D '{"version":"2"}' && \
./signer/test-api -expectedStatus=201 POST $(URL)/lpas/M-AL9A-7EY3-075D/updates '{"type":"BUMP_VERSION","changes":[{"key":"/version","old":"1","new":"2"}]}' && \
./signer/test-api -expectedStatus=200 GET $(URL)/lpas/M-AL9A-7EY3-075D '' | grep '"version":"2"' \
./signer/test-api -expectedStatus=201 PUT $(URL)/lpas/{{UID}} '{"version":"1"}' && \
./signer/test-api -expectedStatus=400 PUT $(URL)/lpas/{{UID}} '{"version":"2"}' && \
./signer/test-api -expectedStatus=201 POST $(URL)/lpas/{{UID}}/updates '{"type":"BUMP_VERSION","changes":[{"key":"/version","old":"1","new":"2"}]}' && \
./signer/test-api -expectedStatus=200 GET $(URL)/lpas/{{UID}} '' | grep '"version":"2"' \

create-tables:
docker compose run --rm aws dynamodb describe-table --table-name deeds || \
Expand Down
5 changes: 4 additions & 1 deletion signer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ func main() {

args := flag.Args()
method := args[0]
url := args[1]

uid := "M-AL9A-7EY3-075D"
url := strings.Replace(args[1], "{{UID}}", uid, -1)

body := strings.NewReader(args[2])

req, err := http.NewRequest(method, url, body)
Expand Down
Binary file added signer/signer
Binary file not shown.

0 comments on commit dd2e1a8

Please sign in to comment.