* fix: remove unused attribute types and functions from backup models * fix: update API client references to use sqlserverflexalpha package * fix: update package references to use sqlserverflexalpha and modify user data source model * fix: add sqlserverflexalpha user data source to provider * fix: add sqlserverflexalpha user resource and update related functionality * chore: add stackit_sqlserverflexalpha_user resource and instance_id variable * fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database * chore: remove not needed service files * chore: cleanup import in utils * fix: provider name change * fix: clone missing doc files * fix: docs adjustments * fix: docs CI scripts * fix: docs naming * fix: remove guides from docs * fix: adjust examples * fix: remove obsolete doc templates * fix: docs adjustments * fix: add missing doc file * fix: temp rename file --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud> Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
// Copyright (c) STACKIT
|
|
|
|
package utils
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
|
)
|
|
|
|
func TestUserAgentConfigOption(t *testing.T) {
|
|
type args struct {
|
|
providerVersion string
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want config.ConfigurationOption
|
|
}{
|
|
{
|
|
name: "TestUserAgentConfigOption",
|
|
args: args{
|
|
providerVersion: "1.0.0",
|
|
},
|
|
want: config.WithUserAgent("stackit-terraform-provider/1.0.0"),
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
clientConfigActual := config.Configuration{}
|
|
err := tt.want(&clientConfigActual)
|
|
if err != nil {
|
|
t.Errorf("error applying configuration: %v", err)
|
|
}
|
|
|
|
clientConfigExpected := config.Configuration{}
|
|
err = UserAgentConfigOption(tt.args.providerVersion)(&clientConfigExpected)
|
|
if err != nil {
|
|
t.Errorf("error applying configuration: %v", err)
|
|
}
|
|
|
|
if !reflect.DeepEqual(clientConfigActual, clientConfigExpected) {
|
|
t.Errorf("UserAgentConfigOption() = %v, want %v", clientConfigActual, clientConfigExpected)
|
|
}
|
|
})
|
|
}
|
|
}
|