@@ -98,7 +98,7 @@ func TestSendFail_AwsSqs(t *testing.T) {
9898	}
9999}
100100
101- func  TestSetOptions_AwsSqs (t  * testing.T ) {
101+ func  TestGetConfigOptions_AwsSqs (t  * testing.T ) {
102102	s  :=  NewTypedAwsSqsService (AwsSqsOptions {
103103		Region : "us-east-1" ,
104104		AwsAccess : AwsAccess {
@@ -109,7 +109,7 @@ func TestSetOptions_AwsSqs(t *testing.T) {
109109	})
110110
111111	options  :=  & config.LoadOptions {}
112- 	optionsF  :=  SetOptions (s )
112+ 	optionsF  :=  GetConfigOptions (s )
113113
114114	for  _ , f  :=  range  optionsF  {
115115		assert .NoError (t , f (options ))
@@ -120,13 +120,9 @@ func TestSetOptions_AwsSqs(t *testing.T) {
120120	creds , _  :=  options .Credentials .Retrieve (context .TODO ())
121121	assert .Equal (t , s .opts .AwsAccess .Key , creds .AccessKeyID )
122122	assert .Equal (t , s .opts .AwsAccess .Secret , creds .SecretAccessKey )
123- 	// Verify custom resolver is used 
124- 	//nolint:staticcheck // SA1019 Migration needed 
125- 	var  resolverType  aws.EndpointResolverWithOptionsFunc 
126- 	assert .IsType (t , resolverType , options .EndpointResolverWithOptions )
127123}
128124
129- func  TestSetOptionsFromEnv_AwsSqs (t  * testing.T ) {
125+ func  TestGetConfigOptionsFromEnv_AwsSqs (t  * testing.T ) {
130126	// Applying override via parameters instead of the ENV Variables 
131127	finalKey , finalSecret , finalRegion  :=  "key" , "secret" , "us-east-1" 
132128
@@ -136,7 +132,7 @@ func TestSetOptionsFromEnv_AwsSqs(t *testing.T) {
136132
137133	s  :=  NewTypedAwsSqsService (AwsSqsOptions {})
138134
139- 	options  :=  SetOptions (s )
135+ 	options  :=  GetConfigOptions (s )
140136	cfg , err  :=  config .LoadDefaultConfig (context .TODO (), options ... )
141137	assert .NoError (t , err )
142138
@@ -147,7 +143,7 @@ func TestSetOptionsFromEnv_AwsSqs(t *testing.T) {
147143	assert .Equal (t , finalRegion , cfg .Region )
148144}
149145
150- func  TestSetOptionsOverrideCredentials_AwsSqs (t  * testing.T ) {
146+ func  TestGetConfigOptionsOverrideCredentials_AwsSqs (t  * testing.T ) {
151147	os .Setenv ("AWS_ACCESS_KEY_ID" , "env_key" )
152148	os .Setenv ("AWS_SECRET_ACCESS_KEY" , "env_secret" )
153149	os .Setenv ("AWS_DEFAULT_REGION" , "us-east-2" )
@@ -163,7 +159,7 @@ func TestSetOptionsOverrideCredentials_AwsSqs(t *testing.T) {
163159		},
164160	})
165161
166- 	options  :=  SetOptions (s )
162+ 	options  :=  GetConfigOptions (s )
167163	cfg , err  :=  config .LoadDefaultConfig (context .TODO (), options ... )
168164	assert .NoError (t , err )
169165
@@ -174,7 +170,7 @@ func TestSetOptionsOverrideCredentials_AwsSqs(t *testing.T) {
174170	assert .Equal (t , finalRegion , cfg .Region )
175171}
176172
177- func  TestSetOptionsCustomEndpointUrl_AwsSqs (t  * testing.T ) {
173+ func  TestGetConfigOptionsCustomEndpointUrl_AwsSqs (t  * testing.T ) {
178174	// Will be overridden 
179175	os .Setenv ("AWS_DEFAULT_REGION" , "us-east-2" )
180176
@@ -189,7 +185,7 @@ func TestSetOptionsCustomEndpointUrl_AwsSqs(t *testing.T) {
189185		EndpointUrl : finalEndpoint ,
190186	})
191187
192- 	options  :=  SetOptions (s )
188+ 	options  :=  GetConfigOptions (s )
193189	cfg , err  :=  config .LoadDefaultConfig (context .TODO (), options ... )
194190	assert .NoError (t , err )
195191
@@ -199,27 +195,10 @@ func TestSetOptionsCustomEndpointUrl_AwsSqs(t *testing.T) {
199195	assert .Equal (t , finalSecret , creds .SecretAccessKey )
200196	assert .Equal (t , finalRegion , cfg .Region )
201197}
202- func  TestSetOptionsCustomResolverFunc (t  * testing.T ) {
203198
204- 	finalKey , finalSecret , finalRegion , finalEndpoint  :=  "key" , "secret" , "us-east-1" , "localhost" 
205- 
206- 	s  :=  NewTypedAwsSqsService (AwsSqsOptions {
207- 		Region : finalRegion ,
208- 		AwsAccess : AwsAccess {
209- 			Key :    finalKey ,
210- 			Secret : finalSecret ,
211- 		},
212- 		EndpointUrl : finalEndpoint ,
213- 	})
214- 
215- 	customResolver  :=  s .getCustomResolver (finalRegion )
216- 	endpoint , err  :=  customResolver (sqs .ServiceID , finalRegion )
217- 	assert .NoError (t , err )
218- 	assert .Equal (t , finalEndpoint , endpoint .URL )
219- 
220- }
221- 
222- func  TestSetOptionsCustomResolverFuncReturnErr (t  * testing.T ) {
199+ func  TestGetClientOptionsCustomEndpointUrl_AwsSqs (t  * testing.T ) {
200+ 	// Will be overridden 
201+ 	os .Setenv ("AWS_DEFAULT_REGION" , "us-east-2" )
223202
224203	finalKey , finalSecret , finalRegion , finalEndpoint  :=  "key" , "secret" , "us-east-1" , "localhost" 
225204
@@ -232,16 +211,13 @@ func TestSetOptionsCustomResolverFuncReturnErr(t *testing.T) {
232211		EndpointUrl : finalEndpoint ,
233212	})
234213
235- 	customResolver  :=  s .getCustomResolver (finalRegion )
236- 	_ , err  :=  customResolver ("NotSQS" , finalRegion )
237- 	assert .Error (t , err )
238- 	//assert that err is of type aws.EndpointNotFoundError 
239- 	assert .IsType (t , & aws.EndpointNotFoundError {}, err )
240- 
214+ 	options  :=  GetClientOptions (s )
215+ 	assert .Equal (t , 2 , len (options ))
241216}
242217
243218// Helpers 
244- var  SetOptions  =  (* awsSqsService ).setOptions 
219+ var  GetConfigOptions  =  (* awsSqsService ).getConfigOptions 
220+ var  GetClientOptions  =  (* awsSqsService ).getClientOptions 
245221var  SendMessageInput  =  (* awsSqsService ).sendMessageInput 
246222
247223var  NewTypedAwsSqsService  =  func (opts  AwsSqsOptions ) * awsSqsService  {
0 commit comments