Skip to content

Commit

Permalink
add unit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
pham vinh dat authored and aldas committed Nov 22, 2024
1 parent c4410fe commit a973e3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,14 @@ func TestDefaultBinder_BindBody(t *testing.T) {
expect: &Node{ID: 0, Node: ""},
expectError: "code=415, message=Unsupported Media Type",
},
{
name: "ok, JSON POST bind to struct with: path + query + http.NoBody",
givenURL: "/api/real_node/endpoint?node=xxx",
givenMethod: http.MethodPost,
givenContentType: MIMEApplicationJSON,
givenContent: http.NoBody,
expect: &Node{ID: 0, Node: ""},
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit a973e3b

Please sign in to comment.