@@ -111,10 +111,7 @@ func TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) {
111
111
112
112
mux .HandleFunc ("/orgs/o/code-security/configurations" , func (w http.ResponseWriter , r * http.Request ) {
113
113
v := new (CodeSecurityConfiguration )
114
- err := json .NewDecoder (r .Body ).Decode (v )
115
- if err != nil {
116
- t .Errorf ("Organizations.CreateCodeSecurityConfiguration request body decode failed: %v" , err )
117
- }
114
+ assertNilError (t , json .NewDecoder (r .Body ).Decode (v ))
118
115
119
116
if ! reflect .DeepEqual (v , input ) {
120
117
t .Errorf ("Organizations.CreateCodeSecurityConfiguration request body = %+v, want %+v" , v , input )
@@ -244,10 +241,7 @@ func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) {
244
241
245
242
mux .HandleFunc ("/orgs/o/code-security/configurations/1" , func (w http.ResponseWriter , r * http.Request ) {
246
243
v := new (CodeSecurityConfiguration )
247
- err := json .NewDecoder (r .Body ).Decode (v )
248
- if err != nil {
249
- t .Errorf ("Organizations.UpdateCodeSecurityConfiguration request body decode failed: %v" , err )
250
- }
244
+ assertNilError (t , json .NewDecoder (r .Body ).Decode (v ))
251
245
252
246
if ! reflect .DeepEqual (v , input ) {
253
247
t .Errorf ("Organizations.UpdateCodeSecurityConfiguration request body = %+v, want %+v" , v , input )
@@ -329,10 +323,7 @@ func TestOrganizationsService_AttachCodeSecurityConfigurationsToRepositories(t *
329
323
SelectedRepositoryIDs []int64 `json:"selected_repository_ids,omitempty"`
330
324
}
331
325
v := new (request )
332
- err := json .NewDecoder (r .Body ).Decode (v )
333
- if err != nil {
334
- t .Errorf ("Organizations.AttachCodeSecurityConfigurationsToRepositories request body decode failed: %v" , err )
335
- }
326
+ assertNilError (t , json .NewDecoder (r .Body ).Decode (v ))
336
327
if v .Scope != "selected" {
337
328
t .Errorf ("Organizations.AttachCodeSecurityConfigurationsToRepositories request body scope = %s, want selected" , v .Scope )
338
329
}
0 commit comments