-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added catch for missing POST body when posted to profileparameters #7194
Changes from 8 commits
78afe26
87e4686
754a27a
cd2b3fa
a1e28f6
903e613
cd37d00
ffbca69
5fc7ec2
1577f83
8d05b3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,11 @@ func TestProfileParameters(t *testing.T) { | |
}, | ||
Expectations: utils.CkRequest(utils.HasError(), utils.HasStatus(http.StatusBadRequest)), | ||
}, | ||
"BAD REQUEST when EMPTY BODY PROVIDED": { | ||
ClientSession: TOSession, | ||
RequestBody: map[string]interface{}{}, | ||
Expectations: utils.CkRequest(utils.HasError(), utils.HasStatus(http.StatusBadRequest)), | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't actually test the behavior being fixed in this PR. Marshalling an empty map appropriately produces an empty object - not an empty request body! |
||
"BAD REQUEST when MISSING PROFILEID field": { | ||
ClientSession: TOSession, | ||
RequestBody: map[string]interface{}{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,11 @@ func TestProfileParameters(t *testing.T) { | |
}, | ||
Expectations: utils.CkRequest(utils.HasError(), utils.HasStatus(http.StatusBadRequest)), | ||
}, | ||
"BAD REQUEST when EMPTY BODY PROVIDED": { | ||
ClientSession: TOSession, | ||
RequestBody: map[string]interface{}{}, | ||
Expectations: utils.CkRequest(utils.HasError(), utils.HasStatus(http.StatusBadRequest)), | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
"BAD REQUEST when MISSING PROFILEID field": { | ||
ClientSession: TOSession, | ||
RequestBody: map[string]interface{}{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't actually test the behavior being fixed in this PR. This a list of length 1 (not 0!) whose only element has the default/"zero" values for all of its properties. The result when Go marshals that is, accordingly, an array with one object element.