Skip to content

Commit ae4ad57

Browse files
authored
Merge pull request #56 from danilopopeye/feature/handle-create-user-response
handle `CreateUser` empty body response
2 parents a1f7d4e + 7758229 commit ae4ad57

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

default_api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,8 @@ func (a *DefaultApiService) CreateUser(localVarOptionals map[string]interface{})
12641264
return NewAPIResponseWithError(localVarHTTPResponse, bodyBytes, reportError("Status: %v, Body: %s", localVarHTTPResponse.Status, bodyBytes))
12651265
}
12661266

1267-
return NewBitbucketAPIResponse(localVarHTTPResponse)
1267+
// No body parsing (a successful 204 response has no content)
1268+
return NewAPIResponse(localVarHTTPResponse), nil
12681269
}
12691270

12701271
/* DefaultApiService

default_api_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,7 @@ func TestDefaultApiService_CreateUser(t *testing.T) {
10031003
wantErr, integrationTest bool
10041004
}{
10051005
{"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Post https://stash.domain.com/rest/api/1.0/admin/users: context canceled"}, true, false},
1006+
{"GoodUser", fields{client: generateConfigFake()}, args{localVarOptionals: map[string]interface{}{"name": "username"}}, &APIResponse{Message: "Post https://stash.domain.com/rest/api/1.0/admin/users?name=username: context canceled"}, true, false},
10061007
}
10071008
for _, tt := range tests {
10081009
if tt.integrationTest != runIntegrationTests {

0 commit comments

Comments
 (0)