Fixing call to SetPermissionForGroup

This commit is contained in:
Ricardo Baptista 2019-07-25 15:50:10 -03:00 committed by Ricardo Baptista
parent c4258a07ac
commit 621ff29cd2

View File

@ -5127,6 +5127,8 @@ func TestDefaultApiService_SetPermissionForGroup(t *testing.T) {
client *APIClient client *APIClient
} }
type args struct { type args struct {
projectKey string
repositorySlug string
localVarOptionals map[string]interface{} localVarOptionals map[string]interface{}
} }
tests := []struct { tests := []struct {
@ -5136,14 +5138,14 @@ func TestDefaultApiService_SetPermissionForGroup(t *testing.T) {
want *APIResponse want *APIResponse
wantErr bool wantErr bool
}{ }{
{"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Put https://stash.domain.com/rest/api/1.0/projects/%7BprojectKey%7D/repos/%7BrepositorySlug%7D/permissions/groups: context canceled"}, true}, {"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Put https://stash.domain.com/rest/api/1.0/projects//repos//permissions/groups: context canceled"}, true},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
a := &DefaultApiService{ a := &DefaultApiService{
client: tt.fields.client, client: tt.fields.client,
} }
got, err := a.SetPermissionForGroup(tt.args.localVarOptionals) got, err := a.SetPermissionForGroup(tt.args.projectKey, tt.args.repositorySlug, tt.args.localVarOptionals)
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
t.Errorf("DefaultApiService.SetPermissionForGroup() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("DefaultApiService.SetPermissionForGroup() error = %v, wantErr %v", err, tt.wantErr)
return return