github.com/webdestroya/awsmocker@v0.2.6/awsconfig_test.go (about) 1 package awsmocker_test 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/aws/aws-sdk-go-v2/service/sts" 8 "github.com/stretchr/testify/require" 9 "github.com/webdestroya/awsmocker" 10 ) 11 12 func TestAwsConfigBuilder(t *testing.T) { 13 info := awsmocker.Start(t, &awsmocker.MockerOptions{ 14 ReturnAwsConfig: true, 15 }) 16 stsClient := sts.NewFromConfig(*info.AwsConfig) 17 18 resp, err := stsClient.GetCallerIdentity(context.TODO(), nil) 19 require.NoError(t, err) 20 require.EqualValuesf(t, awsmocker.DefaultAccountId, *resp.Account, "account id mismatch") 21 }