Alpha (#4)
* chore: initial push to be able to work together * chore: add missing wait folder * chore: add missing folders * chore: cleanup alpha branch * feat: mssql alpha instance (#2) * 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 --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud> Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> * feat: add sqlserver instance * chore: fixing tests * chore: update docs --------- Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
This commit is contained in:
parent
45073a716b
commit
2733834fc9
351 changed files with 62744 additions and 3 deletions
48
stackit/internal/utils/headers_test.go
Normal file
48
stackit/internal/utils/headers_test.go
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
// 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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue