fix: refactor tests
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 5s
CI Workflow / Test readiness for publishing provider (pull_request) Failing after 3m27s
CI Workflow / CI run tests (pull_request) Failing after 4m54s
CI Workflow / CI run build and linting (pull_request) Failing after 4m39s
CI Workflow / Code coverage report (pull_request) Has been skipped

This commit is contained in:
Marcel S. Henselin 2026-03-09 11:03:29 +01:00
parent 826bb5b36a
commit c7260e04e2
19 changed files with 521 additions and 938 deletions

View file

@ -15,7 +15,7 @@ import (
"tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/stackit/internal/core"
"tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/stackit/internal/utils"
"github.com/stackitcloud/stackit-sdk-go/services/postgresflex"
"github.com/stackitcloud/stackit-sdk-go/services/postgresflex/v3alpha1api"
)
const (
@ -38,7 +38,7 @@ func TestConfigureClient(t *testing.T) {
name string
args args
wantErr bool
expected *postgresflex.APIClient
expected *v3alpha1api.APIClient
}{
{
name: "default endpoint",
@ -47,8 +47,8 @@ func TestConfigureClient(t *testing.T) {
Version: testVersion,
},
},
expected: func() *postgresflex.APIClient {
apiClient, err := postgresflex.NewAPIClient(
expected: func() *v3alpha1api.APIClient {
apiClient, err := v3alpha1api.NewAPIClient(
config.WithRegion("eu01"),
utils.UserAgentConfigOption(testVersion),
)
@ -67,8 +67,8 @@ func TestConfigureClient(t *testing.T) {
PostgresFlexCustomEndpoint: testCustomEndpoint,
},
},
expected: func() *postgresflex.APIClient {
apiClient, err := postgresflex.NewAPIClient(
expected: func() *v3alpha1api.APIClient {
apiClient, err := v3alpha1api.NewAPIClient(
utils.UserAgentConfigOption(testVersion),
config.WithEndpoint(testCustomEndpoint),
)