Skip to content

Commit a973e3b

Browse files
pham vinh dataldas
pham vinh dat
authored andcommitted
add unit-test
1 parent c4410fe commit a973e3b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bind_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,14 @@ func TestDefaultBinder_BindBody(t *testing.T) {
10601060
expect: &Node{ID: 0, Node: ""},
10611061
expectError: "code=415, message=Unsupported Media Type",
10621062
},
1063+
{
1064+
name: "ok, JSON POST bind to struct with: path + query + http.NoBody",
1065+
givenURL: "/api/real_node/endpoint?node=xxx",
1066+
givenMethod: http.MethodPost,
1067+
givenContentType: MIMEApplicationJSON,
1068+
givenContent: http.NoBody,
1069+
expect: &Node{ID: 0, Node: ""},
1070+
},
10631071
}
10641072

10651073
for _, tc := range testCases {

0 commit comments

Comments
 (0)