diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 09b64aa..dc7c473 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -20,6 +20,9 @@ jobs: - name: Display Go version run: go version + - name: Format + run: go fmt . && git diff --exit-code + - name: Build run: go build -v ./... diff --git a/default_api_test.go b/default_api_test.go index af59653..9e55b94 100644 --- a/default_api_test.go +++ b/default_api_test.go @@ -6103,6 +6103,7 @@ func TestDefaultApiService_SetDefaultBranch(t *testing.T) { wantErr, integrationTest bool }{ {"networkErrorContextExceeded", fields{client: generateConfigFake()}, args{}, &APIResponse{Message: "Put https://stash.domain.com/rest/api/1.0/projects//repos//branches/default: context canceled"}, true, false}, + {"goodRequest", fields{client: generateConfigRealLocalServer()}, args{"PRJ", "repo1", "ref/branch/master"}, &APIResponse{Values: map[string]interface{}{}}, false, true}, } for _, tt := range tests { if tt.integrationTest != runIntegrationTests { @@ -6117,6 +6118,7 @@ func TestDefaultApiService_SetDefaultBranch(t *testing.T) { t.Errorf("DefaultApiService.SetDefaultBranch() error = %v, wantErr %v", err, tt.wantErr) return } + got.Response = nil if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.SetDefaultBranch() = %v, want %v", got, tt.want) } diff --git a/test/bb-mock-server/mocked_responses/SetDefaultBranch.json b/test/bb-mock-server/mocked_responses/SetDefaultBranch.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/bb-mock-server/mocked_responses/SetDefaultBranch.json @@ -0,0 +1 @@ +{} \ No newline at end of file