Skip to content

Commit

Permalink
fix: tests that were broken from new casing change (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Feb 8, 2024
1 parent 75bafdb commit 290db43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ func TestHttpIngress(t *testing.T) {
assert.True(t, ok, "good_stuff is not a string")
assert.Equal(t, "This is good stuff", goodStuff)
}),
httpCall(rd, http.MethodPost, "/users", jsonData(t, obj{"userID": 123, "postID": 345}), func(t testing.TB, resp *httpResponse) {
httpCall(rd, http.MethodPost, "/users", jsonData(t, obj{"userId": 123, "postId": 345}), func(t testing.TB, resp *httpResponse) {
assert.Equal(t, 201, resp.status)
assert.Equal(t, []string{"Header from FTL"}, resp.headers["Post"])
success, ok := resp.body["success"].(bool)
assert.True(t, ok, "success is not a bool")
assert.True(t, success)
}),
// contains aliased field
httpCall(rd, http.MethodPost, "/users", jsonData(t, obj{"user_id": 123, "postID": 345}), func(t testing.TB, resp *httpResponse) {
httpCall(rd, http.MethodPost, "/users", jsonData(t, obj{"user_id": 123, "postId": 345}), func(t testing.TB, resp *httpResponse) {
assert.Equal(t, 201, resp.status)
}),
httpCall(rd, http.MethodPut, "/users/123", jsonData(t, obj{"postID": "346"}), func(t testing.TB, resp *httpResponse) {
httpCall(rd, http.MethodPut, "/users/123", jsonData(t, obj{"postId": "346"}), func(t testing.TB, resp *httpResponse) {
assert.Equal(t, 200, resp.status)
assert.Equal(t, []string{"Header from FTL"}, resp.headers["Put"])
assert.Equal(t, nil, resp.body)
Expand Down
3 changes: 1 addition & 2 deletions integration/testdata/go/httpingress/echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ type PutRequest struct {
type PutResponse struct{}

//ftl:verb
//ftl:ingress http PUT /users/{userID}
//ftl:ingress http PUT /users/{userId}
func Put(ctx context.Context, req builtin.HttpRequest[PutRequest]) (builtin.HttpResponse[ftl.Unit], error) {
return builtin.HttpResponse[ftl.Unit]{
Status: 200,
Headers: map[string][]string{"Put": {"Header from FTL"}},
Body: ftl.Unit{},
}, nil
Expand Down

0 comments on commit 290db43

Please sign in to comment.