This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
/
AmazonWebServiceTests.groovy
1080 lines (915 loc) · 52.4 KB
/
AmazonWebServiceTests.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package grails.plugin.awssdk
import com.amazonaws.services.autoscaling.AmazonAutoScalingAsyncClient
import com.amazonaws.services.autoscaling.AmazonAutoScalingClient
import com.amazonaws.services.cloudformation.AmazonCloudFormationAsyncClient
import com.amazonaws.services.cloudformation.AmazonCloudFormationClient
import com.amazonaws.services.cloudfront.AmazonCloudFrontAsyncClient
import com.amazonaws.services.cloudfront.AmazonCloudFrontClient
import com.amazonaws.services.cloudsearchv2.AmazonCloudSearchAsyncClient
import com.amazonaws.services.cloudsearchv2.AmazonCloudSearchClient
import com.amazonaws.services.cloudtrail.AWSCloudTrailAsyncClient
import com.amazonaws.services.cloudtrail.AWSCloudTrailClient
import com.amazonaws.services.cloudwatch.AmazonCloudWatchAsyncClient
import com.amazonaws.services.cloudwatch.AmazonCloudWatchClient
import com.amazonaws.services.codedeploy.AmazonCodeDeployAsyncClient
import com.amazonaws.services.codedeploy.AmazonCodeDeployClient
import com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityAsyncClient
import com.amazonaws.services.cognitoidentity.AmazonCognitoIdentityClient
import com.amazonaws.services.cognitosync.AmazonCognitoSyncAsyncClient
import com.amazonaws.services.cognitosync.AmazonCognitoSyncClient
import com.amazonaws.services.config.AmazonConfigAsyncClient
import com.amazonaws.services.config.AmazonConfigClient
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsyncClient
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper
import com.amazonaws.services.ec2.AmazonEC2AsyncClient
import com.amazonaws.services.ec2.AmazonEC2Client
import com.amazonaws.services.elasticache.AmazonElastiCacheAsyncClient
import com.amazonaws.services.elasticache.AmazonElastiCacheClient
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkAsyncClient
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient
import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancingAsyncClient
import com.amazonaws.services.elasticloadbalancing.AmazonElasticLoadBalancingClient
import com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceAsyncClient
import com.amazonaws.services.elasticmapreduce.AmazonElasticMapReduceClient
import com.amazonaws.services.elastictranscoder.AmazonElasticTranscoderAsyncClient
import com.amazonaws.services.elastictranscoder.AmazonElasticTranscoderClient
import com.amazonaws.services.glacier.AmazonGlacierAsyncClient
import com.amazonaws.services.glacier.AmazonGlacierClient
import com.amazonaws.services.identitymanagement.AmazonIdentityManagementAsyncClient
import com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient
import com.amazonaws.services.importexport.AmazonImportExportAsyncClient
import com.amazonaws.services.importexport.AmazonImportExportClient
import com.amazonaws.services.kinesis.AmazonKinesisAsyncClient
import com.amazonaws.services.kinesis.AmazonKinesisClient
import com.amazonaws.services.kms.AWSKMSAsyncClient
import com.amazonaws.services.kms.AWSKMSClient
import com.amazonaws.services.opsworks.AWSOpsWorksAsyncClient
import com.amazonaws.services.opsworks.AWSOpsWorksClient
import com.amazonaws.services.rds.AmazonRDSAsyncClient
import com.amazonaws.services.rds.AmazonRDSClient
import com.amazonaws.services.redshift.AmazonRedshiftAsyncClient
import com.amazonaws.services.redshift.AmazonRedshiftClient
import com.amazonaws.services.route53.AmazonRoute53AsyncClient
import com.amazonaws.services.route53.AmazonRoute53Client
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.AmazonS3EncryptionClient
import com.amazonaws.services.s3.model.EncryptionMaterials
import com.amazonaws.services.s3.transfer.TransferManager
import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceAsyncClient
import com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient
import com.amazonaws.services.simpledb.AmazonSimpleDBAsyncClient
import com.amazonaws.services.simpledb.AmazonSimpleDBClient
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsyncClient
import com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowAsyncClient
import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient
import com.amazonaws.services.sns.AmazonSNSAsyncClient
import com.amazonaws.services.sns.AmazonSNSClient
import com.amazonaws.services.sqs.AmazonSQSAsyncClient
import com.amazonaws.services.sqs.AmazonSQSClient
import com.amazonaws.services.sqs.buffered.AmazonSQSBufferedAsyncClient
import com.amazonaws.services.storagegateway.AWSStorageGatewayAsyncClient
import com.amazonaws.services.storagegateway.AWSStorageGatewayClient
import grails.test.mixin.TestMixin
import grails.test.mixin.support.GrailsUnitTestMixin
import java.security.KeyPair
import java.security.KeyPairGenerator
import java.security.SecureRandom
@TestMixin(GrailsUnitTestMixin)
class AmazonWebServiceTests {
protected ConfigObject getAwsConfig() {
grailsApplication.config.grails.plugin.awssdk
}
protected AmazonWebService getServiceWithCredentials() {
awsConfig.accessKey = "abcdefghi"
awsConfig.secretKey = "123456789"
new AmazonWebService(grailsApplication: grailsApplication)
}
protected AmazonWebService getServiceWithCredentialsAndEncryptionMaterials() {
def amazonWebService = serviceWithCredentials
KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("RSA")
keyGenerator.initialize(1024, new SecureRandom())
KeyPair myKeyPair = keyGenerator.generateKeyPair()
EncryptionMaterials encryptionMaterials = new EncryptionMaterials(myKeyPair)
awsConfig.encryptionMaterials = encryptionMaterials
amazonWebService
}
protected AmazonWebService getServiceWithoutCredentials() {
new AmazonWebService(grailsApplication: grailsApplication)
}
void testAutoScalingClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getAutoScalingAsync().class == AmazonAutoScalingAsyncClient
assert amazonWebService.getAutoScalingAsync('eu-west-1').class == AmazonAutoScalingAsyncClient
assert amazonWebService.getAutoScaling().class == AmazonAutoScalingClient
assert amazonWebService.getAutoScaling('eu-west-1').class == AmazonAutoScalingClient
assert amazonWebService.getAutoScaling('eu-west-1').endpoint.toString() == 'https://autoscaling.eu-west-1.amazonaws.com'
}
void testAutoScalingClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getAutoScalingAsync().class == AmazonAutoScalingAsyncClient
assert amazonWebService.getAutoScalingAsync('eu-west-1').class == AmazonAutoScalingAsyncClient
assert amazonWebService.getAutoScaling().class == AmazonAutoScalingClient
assert amazonWebService.getAutoScaling('eu-west-1').class == AmazonAutoScalingClient
assert amazonWebService.getAutoScaling('eu-west-1').endpoint.toString() == 'https://autoscaling.eu-west-1.amazonaws.com'
}
void testCloudFormationClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCloudFormationAsync().class == AmazonCloudFormationAsyncClient
assert amazonWebService.getCloudFormationAsync('eu-west-1').class == AmazonCloudFormationAsyncClient
assert amazonWebService.getCloudFormation().class == AmazonCloudFormationClient
assert amazonWebService.getCloudFormation('eu-west-1').class == AmazonCloudFormationClient
assert amazonWebService.getCloudFormation('eu-west-1').endpoint.toString() == 'https://cloudformation.eu-west-1.amazonaws.com'
}
void testCloudFormationClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCloudFormationAsync().class == AmazonCloudFormationAsyncClient
assert amazonWebService.getCloudFormationAsync('eu-west-1').class == AmazonCloudFormationAsyncClient
assert amazonWebService.getCloudFormation().class == AmazonCloudFormationClient
assert amazonWebService.getCloudFormation('eu-west-1').class == AmazonCloudFormationClient
assert amazonWebService.getCloudFormation('eu-west-1').endpoint.toString() == 'https://cloudformation.eu-west-1.amazonaws.com'
}
void testCloudFrontClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCloudFrontAsync().class == AmazonCloudFrontAsyncClient
assert amazonWebService.getCloudFrontAsync().endpoint.toString() == 'https://cloudfront.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getCloudFrontAsync('eu-west-1')
}
assert amazonWebService.getCloudFront().class == AmazonCloudFrontClient
assert amazonWebService.getCloudFront().endpoint.toString() == 'https://cloudfront.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getCloudFront('eu-west-1')
}
}
void testCloudFrontClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCloudFrontAsync().class == AmazonCloudFrontAsyncClient
assert amazonWebService.getCloudFrontAsync().endpoint.toString() == 'https://cloudfront.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getCloudFrontAsync('eu-west-1')
}
assert amazonWebService.getCloudFront().class == AmazonCloudFrontClient
assert amazonWebService.getCloudFront().endpoint.toString() == 'https://cloudfront.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getCloudFront('eu-west-1')
}
}
void testCloudSearchClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCloudSearchAsync().class == AmazonCloudSearchAsyncClient
assert amazonWebService.getCloudSearchAsync('eu-west-1').class == AmazonCloudSearchAsyncClient
assert amazonWebService.getCloudSearch().class == AmazonCloudSearchClient
assert amazonWebService.getCloudSearch('eu-west-1').class == AmazonCloudSearchClient
assert amazonWebService.getCloudSearch('eu-west-1').endpoint.toString() == 'https://cloudsearch.eu-west-1.amazonaws.com'
}
void testCloudSearchClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCloudSearchAsync().class == AmazonCloudSearchAsyncClient
assert amazonWebService.getCloudSearchAsync('eu-west-1').class == AmazonCloudSearchAsyncClient
assert amazonWebService.getCloudSearch().class == AmazonCloudSearchClient
assert amazonWebService.getCloudSearch('eu-west-1').class == AmazonCloudSearchClient
assert amazonWebService.getCloudSearch('eu-west-1').endpoint.toString() == 'https://cloudsearch.eu-west-1.amazonaws.com'
}
void testCloudTrailClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCloudTrailAsync().class == AWSCloudTrailAsyncClient
assert amazonWebService.getCloudTrailAsync().endpoint.toString() == 'https://cloudtrail.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getCloudTrailAsync('eu-west-1')
}*/
assert amazonWebService.getCloudTrail().class == AWSCloudTrailClient
assert amazonWebService.getCloudTrail().endpoint.toString() == 'https://cloudtrail.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getCloudTrail('eu-west-1')
}*/
}
void testCloudTrailClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCloudTrailAsync().class == AWSCloudTrailAsyncClient
assert amazonWebService.getCloudTrailAsync().endpoint.toString() == 'https://cloudtrail.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getCloudTrailAsync('eu-west-1')
}*/
assert amazonWebService.getCloudTrail().class == AWSCloudTrailClient
assert amazonWebService.getCloudTrail().endpoint.toString() == 'https://cloudtrail.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getCloudTrail('eu-west-1')
}*/
}
/**
* CloudWatch
*/
void testCloudWatchClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCloudWatchAsync().class == AmazonCloudWatchAsyncClient
assert amazonWebService.getCloudWatchAsync('eu-west-1').class == AmazonCloudWatchAsyncClient
assert amazonWebService.getCloudWatch().class == AmazonCloudWatchClient
assert amazonWebService.getCloudWatch('eu-west-1').class == AmazonCloudWatchClient
assert amazonWebService.getCloudWatch('eu-west-1').endpoint.toString() == 'https://monitoring.eu-west-1.amazonaws.com'
}
void testCloudWatchClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCloudWatchAsync().class == AmazonCloudWatchAsyncClient
assert amazonWebService.getCloudWatchAsync('eu-west-1').class == AmazonCloudWatchAsyncClient
assert amazonWebService.getCloudWatch().class == AmazonCloudWatchClient
assert amazonWebService.getCloudWatch('eu-west-1').class == AmazonCloudWatchClient
assert amazonWebService.getCloudWatch('eu-west-1').endpoint.toString() == 'https://monitoring.eu-west-1.amazonaws.com'
}
/**
* CodeDeploy
*/
void testCodeDeployClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCodeDeployAsync().class == AmazonCodeDeployAsyncClient
assert amazonWebService.getCodeDeployAsync('eu-west-1').class == AmazonCodeDeployAsyncClient
assert amazonWebService.getCodeDeploy().class == AmazonCodeDeployClient
assert amazonWebService.getCodeDeploy('eu-west-1').class == AmazonCodeDeployClient
assert amazonWebService.getCodeDeploy('eu-west-1').endpoint.toString() == 'https://codedeploy.us-east-1.amazonaws.com' // Currently only available in us-east-1
}
void testCodeDeployClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCodeDeployAsync().class == AmazonCodeDeployAsyncClient
assert amazonWebService.getCodeDeployAsync('eu-west-1').class == AmazonCodeDeployAsyncClient
assert amazonWebService.getCodeDeploy().class == AmazonCodeDeployClient
assert amazonWebService.getCodeDeploy('eu-west-1').class == AmazonCodeDeployClient
assert amazonWebService.getCodeDeploy('eu-west-1').endpoint.toString() == 'https://codedeploy.us-east-1.amazonaws.com' // Currently only available in us-east-1
}
/**
* CognitoIdentity
*/
void testCognitoIdentityClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCognitoIdentityAsync().class == AmazonCognitoIdentityAsyncClient
assert amazonWebService.getCognitoIdentityAsync('eu-west-1').class == AmazonCognitoIdentityAsyncClient
assert amazonWebService.getCognitoIdentity().class == AmazonCognitoIdentityClient
assert amazonWebService.getCognitoIdentity('eu-west-1').class == AmazonCognitoIdentityClient
assert amazonWebService.getCognitoIdentity('eu-west-1').endpoint.toString() == 'https://cognito-identity.eu-west-1.amazonaws.com'
}
void testCognitoIdentityClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCognitoIdentityAsync().class == AmazonCognitoIdentityAsyncClient
assert amazonWebService.getCognitoIdentityAsync('eu-west-1').class == AmazonCognitoIdentityAsyncClient
assert amazonWebService.getCognitoIdentity().class == AmazonCognitoIdentityClient
assert amazonWebService.getCognitoIdentity('eu-west-1').class == AmazonCognitoIdentityClient
assert amazonWebService.getCognitoIdentity('eu-west-1').endpoint.toString() == 'https://cognito-identity.eu-west-1.amazonaws.com'
}
/**
* CognitoSync
*/
void testCognitoSyncClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getCognitoSyncAsync().class == AmazonCognitoSyncAsyncClient
assert amazonWebService.getCognitoSyncAsync('eu-west-1').class == AmazonCognitoSyncAsyncClient
assert amazonWebService.getCognitoSync().class == AmazonCognitoSyncClient
assert amazonWebService.getCognitoSync('eu-west-1').class == AmazonCognitoSyncClient
assert amazonWebService.getCognitoSync('eu-west-1').endpoint.toString() == 'https://cognito-sync.eu-west-1.amazonaws.com'
}
void testCognitoSyncClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getCognitoSyncAsync().class == AmazonCognitoSyncAsyncClient
assert amazonWebService.getCognitoSyncAsync('eu-west-1').class == AmazonCognitoSyncAsyncClient
assert amazonWebService.getCognitoSync().class == AmazonCognitoSyncClient
assert amazonWebService.getCognitoSync('eu-west-1').class == AmazonCognitoSyncClient
assert amazonWebService.getCognitoSync('eu-west-1').endpoint.toString() == 'https://cognito-sync.eu-west-1.amazonaws.com'
}
/**
* Config
*/
void testConfigClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getConfigAsync().class == AmazonConfigAsyncClient
assert amazonWebService.getConfigAsync('eu-west-1').class == AmazonConfigAsyncClient
assert amazonWebService.getConfig().class == AmazonConfigClient
assert amazonWebService.getConfig('eu-west-1').class == AmazonConfigClient
assert amazonWebService.getConfig('eu-west-1').endpoint.toString() == 'https://config.us-east-1.amazonaws.com' // Currently only available in us-east-1
}
void testConfigClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getConfigAsync().class == AmazonConfigAsyncClient
assert amazonWebService.getConfigAsync('eu-west-1').class == AmazonConfigAsyncClient
assert amazonWebService.getConfig().class == AmazonConfigClient
assert amazonWebService.getConfig('eu-west-1').class == AmazonConfigClient
assert amazonWebService.getConfig('eu-west-1').endpoint.toString() == 'https://config.us-east-1.amazonaws.com' // Currently only available in us-east-1
}
/**
* DynamoDB
*/
void testDynamoDBClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getDynamoDBAsync().class == AmazonDynamoDBAsyncClient
assert amazonWebService.getDynamoDBAsync('eu-west-1').class == AmazonDynamoDBAsyncClient
assert amazonWebService.getDynamoDB().class == AmazonDynamoDBClient
assert amazonWebService.getDynamoDB('eu-west-1').class == AmazonDynamoDBClient
assert amazonWebService.getDynamoDB('eu-west-1').endpoint.toString() == 'https://dynamodb.eu-west-1.amazonaws.com'
}
void testDynamoDBClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getDynamoDBAsync().class == AmazonDynamoDBAsyncClient
assert amazonWebService.getDynamoDBAsync('eu-west-1').class == AmazonDynamoDBAsyncClient
assert amazonWebService.getDynamoDB().class == AmazonDynamoDBClient
assert amazonWebService.getDynamoDB('eu-west-1').class == AmazonDynamoDBClient
assert amazonWebService.getDynamoDB('eu-west-1').endpoint.toString() == 'https://dynamodb.eu-west-1.amazonaws.com'
}
/**
* Ec2
*/
void testEc2ClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getEc2Async().class == AmazonEC2AsyncClient
assert amazonWebService.getEc2Async('eu-west-1').class == AmazonEC2AsyncClient
assert amazonWebService.getEc2().class == AmazonEC2Client
assert amazonWebService.getEc2('eu-west-1').class == AmazonEC2Client
assert amazonWebService.getEc2('eu-west-1').endpoint.toString() == 'https://ec2.eu-west-1.amazonaws.com'
}
void testEc2ClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getEc2Async().class == AmazonEC2AsyncClient
assert amazonWebService.getEc2Async('eu-west-1').class == AmazonEC2AsyncClient
assert amazonWebService.getEc2().class == AmazonEC2Client
assert amazonWebService.getEc2('eu-west-1').class == AmazonEC2Client
assert amazonWebService.getEc2('eu-west-1').endpoint.toString() == 'https://ec2.eu-west-1.amazonaws.com'
}
/**
* ElasticBeanstalk
*/
void testElasticBeanstalkClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getElasticBeanstalkAsync().class == AWSElasticBeanstalkAsyncClient
assert amazonWebService.getElasticBeanstalkAsync('eu-west-1').class == AWSElasticBeanstalkAsyncClient
assert amazonWebService.getElasticBeanstalk().class == AWSElasticBeanstalkClient
assert amazonWebService.getElasticBeanstalk('eu-west-1').class == AWSElasticBeanstalkClient
assert amazonWebService.getElasticBeanstalk('eu-west-1').endpoint.toString() == 'https://elasticbeanstalk.eu-west-1.amazonaws.com'
}
void testElasticBeanstalkClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getElasticBeanstalkAsync().class == AWSElasticBeanstalkAsyncClient
assert amazonWebService.getElasticBeanstalkAsync('eu-west-1').class == AWSElasticBeanstalkAsyncClient
assert amazonWebService.getElasticBeanstalk().class == AWSElasticBeanstalkClient
assert amazonWebService.getElasticBeanstalk('eu-west-1').class == AWSElasticBeanstalkClient
assert amazonWebService.getElasticBeanstalk('eu-west-1').endpoint.toString() == 'https://elasticbeanstalk.eu-west-1.amazonaws.com'
}
/**
* ElastiCache
*/
void testElastiCacheClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getElastiCacheAsync().class == AmazonElastiCacheAsyncClient
assert amazonWebService.getElastiCacheAsync('eu-west-1').class == AmazonElastiCacheAsyncClient
assert amazonWebService.getElastiCache().class == AmazonElastiCacheClient
assert amazonWebService.getElastiCache('eu-west-1').class == AmazonElastiCacheClient
assert amazonWebService.getElastiCache('eu-west-1').endpoint.toString() == 'https://elasticache.eu-west-1.amazonaws.com'
}
void testElastiCacheClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getElastiCacheAsync().class == AmazonElastiCacheAsyncClient
assert amazonWebService.getElastiCacheAsync('eu-west-1').class == AmazonElastiCacheAsyncClient
assert amazonWebService.getElastiCache().class == AmazonElastiCacheClient
assert amazonWebService.getElastiCache('eu-west-1').class == AmazonElastiCacheClient
assert amazonWebService.getElastiCache('eu-west-1').endpoint.toString() == 'https://elasticache.eu-west-1.amazonaws.com'
}
/**
* ElasticLoadBalancing
*/
void testElasticLoadBalancingClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getElasticLoadBalancingAsync().class == AmazonElasticLoadBalancingAsyncClient
assert amazonWebService.getElasticLoadBalancingAsync('eu-west-1').class == AmazonElasticLoadBalancingAsyncClient
assert amazonWebService.getElasticLoadBalancing().class == AmazonElasticLoadBalancingClient
assert amazonWebService.getElasticLoadBalancing('eu-west-1').class == AmazonElasticLoadBalancingClient
assert amazonWebService.getElasticLoadBalancing('eu-west-1').endpoint.toString() == 'https://elasticloadbalancing.eu-west-1.amazonaws.com'
}
void testElasticLoadBalancingClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getElasticLoadBalancingAsync().class == AmazonElasticLoadBalancingAsyncClient
assert amazonWebService.getElasticLoadBalancingAsync('eu-west-1').class == AmazonElasticLoadBalancingAsyncClient
assert amazonWebService.getElasticLoadBalancing().class == AmazonElasticLoadBalancingClient
assert amazonWebService.getElasticLoadBalancing('eu-west-1').class == AmazonElasticLoadBalancingClient
assert amazonWebService.getElasticLoadBalancing('eu-west-1').endpoint.toString() == 'https://elasticloadbalancing.eu-west-1.amazonaws.com'
}
/**
* ElasticMapReduce
*/
void testElasticMapReduceClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getElasticMapReduceAsync().class == AmazonElasticMapReduceAsyncClient
assert amazonWebService.getElasticMapReduceAsync('eu-west-1').class == AmazonElasticMapReduceAsyncClient
assert amazonWebService.getElasticMapReduce().class == AmazonElasticMapReduceClient
assert amazonWebService.getElasticMapReduce('eu-west-1').class == AmazonElasticMapReduceClient
assert amazonWebService.getElasticMapReduce('eu-west-1').endpoint.toString() == 'https://elasticmapreduce.eu-west-1.amazonaws.com'
}
void testElasticMapReduceClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getElasticMapReduceAsync().class == AmazonElasticMapReduceAsyncClient
assert amazonWebService.getElasticMapReduceAsync('eu-west-1').class == AmazonElasticMapReduceAsyncClient
assert amazonWebService.getElasticMapReduce().class == AmazonElasticMapReduceClient
assert amazonWebService.getElasticMapReduce('eu-west-1').class == AmazonElasticMapReduceClient
assert amazonWebService.getElasticMapReduce('eu-west-1').endpoint.toString() == 'https://elasticmapreduce.eu-west-1.amazonaws.com'
}
/**
* ElasticTranscoder
*/
void testElasticTranscoderClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getElasticTranscoderAsync().class == AmazonElasticTranscoderAsyncClient
assert amazonWebService.getElasticTranscoderAsync('eu-west-1').class == AmazonElasticTranscoderAsyncClient
assert amazonWebService.getElasticTranscoder().class == AmazonElasticTranscoderClient
assert amazonWebService.getElasticTranscoder('eu-west-1').class == AmazonElasticTranscoderClient
assert amazonWebService.getElasticTranscoder('eu-west-1').endpoint.toString() == 'https://elastictranscoder.eu-west-1.amazonaws.com'
}
void testElasticTranscoderClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getElasticTranscoderAsync().class == AmazonElasticTranscoderAsyncClient
assert amazonWebService.getElasticTranscoderAsync('eu-west-1').class == AmazonElasticTranscoderAsyncClient
assert amazonWebService.getElasticTranscoder().class == AmazonElasticTranscoderClient
assert amazonWebService.getElasticTranscoder('eu-west-1').class == AmazonElasticTranscoderClient
assert amazonWebService.getElasticTranscoder('eu-west-1').endpoint.toString() == 'https://elastictranscoder.eu-west-1.amazonaws.com'
}
/**
* Glacier
*/
void testGlacierClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getGlacierAsync().class == AmazonGlacierAsyncClient
assert amazonWebService.getGlacierAsync('eu-west-1').class == AmazonGlacierAsyncClient
assert amazonWebService.getGlacier().class == AmazonGlacierClient
assert amazonWebService.getGlacier('eu-west-1').class == AmazonGlacierClient
assert amazonWebService.getGlacier('eu-west-1').endpoint.toString() == 'https://glacier.eu-west-1.amazonaws.com'
}
void testGlacierClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getGlacierAsync().class == AmazonGlacierAsyncClient
assert amazonWebService.getGlacierAsync('eu-west-1').class == AmazonGlacierAsyncClient
assert amazonWebService.getGlacier().class == AmazonGlacierClient
assert amazonWebService.getGlacier('eu-west-1').class == AmazonGlacierClient
assert amazonWebService.getGlacier('eu-west-1').endpoint.toString() == 'https://glacier.eu-west-1.amazonaws.com'
}
/**
* Iam
*/
void testIamClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getIamAsync().class == AmazonIdentityManagementAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getIamAsync('eu-west-1')
}
assert amazonWebService.getIam().class == AmazonIdentityManagementClient
assert amazonWebService.getIam().endpoint.toString() == 'https://iam.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getIam('eu-west-1')
}
}
void testIamClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getIamAsync().class == AmazonIdentityManagementAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getIamAsync('eu-west-1')
}
assert amazonWebService.getIam().class == AmazonIdentityManagementClient
assert amazonWebService.getIam().endpoint.toString() == 'https://iam.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getIam('eu-west-1')
}
}
/**
* ImportExport
*/
void testImportExportClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getImportExportAsync().class == AmazonImportExportAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getImportExportAsync('eu-west-1')
}
assert amazonWebService.getImportExport().class == AmazonImportExportClient
assert amazonWebService.getImportExport().endpoint.toString() == 'https://importexport.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getImportExport('eu-west-1')
}
}
void testImportExportClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getImportExportAsync().class == AmazonImportExportAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getImportExportAsync('eu-west-1')
}
assert amazonWebService.getImportExport().class == AmazonImportExportClient
assert amazonWebService.getImportExport().endpoint.toString() == 'https://importexport.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getImportExport('eu-west-1')
}
}
/**
* Kinesis
*/
void testKinesisAsyncWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getKinesisAsync().class == AmazonKinesisAsyncClient
assert amazonWebService.getKinesisAsync().endpoint.toString() == 'https://kinesis.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getKinesisAsync('eu-west-1')
}*/
assert amazonWebService.getKinesis().class == AmazonKinesisClient
assert amazonWebService.getKinesis().endpoint.toString() == 'https://kinesis.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getKinesis('eu-west-1')
}*/
}
void testKinesisAsyncWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getKinesisAsync().class == AmazonKinesisAsyncClient
assert amazonWebService.getKinesisAsync().endpoint.toString() == 'https://kinesis.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getKinesisAsync('eu-west-1')
}*/
assert amazonWebService.getKinesis().class == AmazonKinesisClient
assert amazonWebService.getKinesis().endpoint.toString() == 'https://kinesis.us-east-1.amazonaws.com'
/*shouldFail(MissingMethodException) {
amazonWebService.getKinesis('eu-west-1')
}*/
}
/**
* KMS
*/
void testKMSClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getKMSAsync().class == AWSKMSAsyncClient
assert amazonWebService.getKMSAsync('eu-west-1').class == AWSKMSAsyncClient
assert amazonWebService.getKMS().class == AWSKMSClient
assert amazonWebService.getKMS('eu-west-1').class == AWSKMSClient
assert amazonWebService.getKMS('eu-west-1').endpoint.toString() == 'https://kms.eu-west-1.amazonaws.com'
}
void testKMSClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getKMSAsync().class == AWSKMSAsyncClient
assert amazonWebService.getKMSAsync('eu-west-1').class == AWSKMSAsyncClient
assert amazonWebService.getKMS().class == AWSKMSClient
assert amazonWebService.getKMS('eu-west-1').class == AWSKMSClient
assert amazonWebService.getKMS('eu-west-1').endpoint.toString() == 'https://kms.eu-west-1.amazonaws.com'
}
/**
* OpsWorks
*/
void testOpsWorksAsyncWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getOpsWorksAsync().class == AWSOpsWorksAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getOpsWorksAsync('eu-west-1')
}
assert amazonWebService.getOpsWorks().class == AWSOpsWorksClient
assert amazonWebService.getOpsWorks().endpoint.toString() == 'https://opsworks.us-east-1.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getOpsWorks('eu-west-1')
}
}
void testOpsWorksAsyncWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getOpsWorksAsync().class == AWSOpsWorksAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getOpsWorksAsync('eu-west-1')
}
assert amazonWebService.getOpsWorks().class == AWSOpsWorksClient
assert amazonWebService.getOpsWorks().endpoint.toString() == 'https://opsworks.us-east-1.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getOpsWorks('eu-west-1')
}
}
/**
* Rds
*/
void testRdsClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getRdsAsync().class == AmazonRDSAsyncClient
assert amazonWebService.getRdsAsync('eu-west-1').class == AmazonRDSAsyncClient
assert amazonWebService.getRds().class == AmazonRDSClient
assert amazonWebService.getRds('eu-west-1').class == AmazonRDSClient
assert amazonWebService.getRds('eu-west-1').endpoint.toString() == 'https://rds.eu-west-1.amazonaws.com'
}
void testRdsClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getRdsAsync().class == AmazonRDSAsyncClient
assert amazonWebService.getRdsAsync('eu-west-1').class == AmazonRDSAsyncClient
assert amazonWebService.getRds().class == AmazonRDSClient
assert amazonWebService.getRds('eu-west-1').class == AmazonRDSClient
assert amazonWebService.getRds('eu-west-1').endpoint.toString() == 'https://rds.eu-west-1.amazonaws.com'
}
/**
* Redshift
*/
void testRedshiftClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getRedshiftAsync().class == AmazonRedshiftAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getRedshiftAsync('eu-west-1')
}
assert amazonWebService.getRedshift().class == AmazonRedshiftClient
assert amazonWebService.getRedshift().endpoint.toString() == 'https://redshift.us-east-1.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getRedshift('eu-west-1')
}
}
void testRedshiftClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getRedshiftAsync().class == AmazonRedshiftAsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getRedshiftAsync('eu-west-1')
}
assert amazonWebService.getRedshift().class == AmazonRedshiftClient
assert amazonWebService.getRedshift().endpoint.toString() == 'https://redshift.us-east-1.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getRedshift('eu-west-1')
}
}
/**
* Route53
*/
void testRoute53ClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getRoute53Async().class == AmazonRoute53AsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getRoute53Async('eu-west-1')
}
assert amazonWebService.getRoute53().class == AmazonRoute53Client
assert amazonWebService.getRoute53().endpoint.toString() == 'https://route53.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getRoute53('eu-west-1')
}
}
void testRoute53ClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getRoute53Async().class == AmazonRoute53AsyncClient
shouldFail(MissingMethodException) {
amazonWebService.getRoute53Async('eu-west-1')
}
assert amazonWebService.getRoute53().class == AmazonRoute53Client
assert amazonWebService.getRoute53().endpoint.toString() == 'https://route53.amazonaws.com'
shouldFail(MissingMethodException) {
amazonWebService.getRoute53('eu-west-1')
}
}
/**
* S3
*/
void testS3ClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
shouldFail(MissingMethodException) {
amazonWebService.getS3Async()
}
shouldFail(MissingMethodException) {
amazonWebService.getS3Async('eu-west-1')
}
assert amazonWebService.getS3().class == AmazonS3Client
assert amazonWebService.getS3().endpoint.toString() == 'https://s3.amazonaws.com'
assert amazonWebService.getS3('eu-west-1').class == AmazonS3Client
assert amazonWebService.getS3('eu-west-1').endpoint.toString() == 'https://s3-eu-west-1.amazonaws.com'
}
void testS3ClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
shouldFail(MissingMethodException) {
amazonWebService.getS3Async()
}
shouldFail(MissingMethodException) {
amazonWebService.getS3Async('eu-west-1')
}
assert amazonWebService.getS3().class == AmazonS3Client
assert amazonWebService.getS3().endpoint.toString() == 'https://s3.amazonaws.com'
assert amazonWebService.getS3('eu-west-1').class == AmazonS3Client
assert amazonWebService.getS3('eu-west-1').endpoint.toString() == 'https://s3-eu-west-1.amazonaws.com'
}
/**
* S3Entryption
*/
void testS3EncryptionClientWithCredentials() {
def amazonWebService = getServiceWithCredentialsAndEncryptionMaterials()
shouldFail(MissingMethodException) {
amazonWebService.getS3EncryptionAsync()
}
shouldFail(MissingMethodException) {
amazonWebService.getS3EncryptionAsync('eu-west-1')
}
assert amazonWebService.getS3Encryption().class == AmazonS3EncryptionClient
assert amazonWebService.getS3Encryption().endpoint.toString() == 'https://s3.amazonaws.com'
assert amazonWebService.getS3Encryption('eu-west-1').class == AmazonS3EncryptionClient
assert amazonWebService.getS3Encryption('eu-west-1').endpoint.toString() == 'https://s3-eu-west-1.amazonaws.com'
}
void testS3EncryptionClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
shouldFail(MissingMethodException) {
amazonWebService.getS3EncryptionAsync()
}
shouldFail(MissingMethodException) {
amazonWebService.getS3EncryptionAsync('eu-west-1')
}
assert amazonWebService.getS3Encryption().class == AmazonS3EncryptionClient
assert amazonWebService.getS3Encryption().endpoint.toString() == 'https://s3.amazonaws.com'
assert amazonWebService.getS3Encryption('eu-west-1').class == AmazonS3EncryptionClient
assert amazonWebService.getS3Encryption('eu-west-1').endpoint.toString() == 'https://s3-eu-west-1.amazonaws.com'
}
/**
* Sdb
*/
void testSdbClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSdbAsync().class == AmazonSimpleDBAsyncClient
assert amazonWebService.getSdbAsync('eu-west-1').class == AmazonSimpleDBAsyncClient
assert amazonWebService.getSdb().class == AmazonSimpleDBClient
assert amazonWebService.getSdb('eu-west-1').class == AmazonSimpleDBClient
assert amazonWebService.getSdb('eu-west-1').endpoint.toString() == 'https://sdb.eu-west-1.amazonaws.com'
}
void testSdbClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getSdbAsync().class == AmazonSimpleDBAsyncClient
assert amazonWebService.getSdbAsync('eu-west-1').class == AmazonSimpleDBAsyncClient
assert amazonWebService.getSdb().class == AmazonSimpleDBClient
assert amazonWebService.getSdb('eu-west-1').class == AmazonSimpleDBClient
assert amazonWebService.getSdb('eu-west-1').endpoint.toString() == 'https://sdb.eu-west-1.amazonaws.com'
}
/**
* Ses
*/
void testSesClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSesAsync().class == AmazonSimpleEmailServiceAsyncClient
assert amazonWebService.getSesAsync('eu-west-1').class == AmazonSimpleEmailServiceAsyncClient
assert amazonWebService.getSes().class == AmazonSimpleEmailServiceClient
assert amazonWebService.getSes('eu-west-1').class == AmazonSimpleEmailServiceClient
assert amazonWebService.getSes('eu-west-1').endpoint.toString() == 'https://email.eu-west-1.amazonaws.com'
}
void testSesClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getSesAsync().class == AmazonSimpleEmailServiceAsyncClient
assert amazonWebService.getSesAsync('eu-west-1').class == AmazonSimpleEmailServiceAsyncClient
assert amazonWebService.getSes().class == AmazonSimpleEmailServiceClient
assert amazonWebService.getSes('eu-west-1').class == AmazonSimpleEmailServiceClient
assert amazonWebService.getSes('eu-west-1').endpoint.toString() == 'https://email.eu-west-1.amazonaws.com'
}
/**
* Sns
*/
void testSnsClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSnsAsync().class == AmazonSNSAsyncClient
assert amazonWebService.getSnsAsync('eu-west-1').class == AmazonSNSAsyncClient
assert amazonWebService.getSns().class == AmazonSNSClient
assert amazonWebService.getSns('eu-west-1').class == AmazonSNSClient
assert amazonWebService.getSns('eu-west-1').endpoint.toString() == 'https://sns.eu-west-1.amazonaws.com'
}
void testSnsClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getSnsAsync().class == AmazonSNSAsyncClient
assert amazonWebService.getSnsAsync('eu-west-1').class == AmazonSNSAsyncClient
assert amazonWebService.getSns().class == AmazonSNSClient
assert amazonWebService.getSns('eu-west-1').class == AmazonSNSClient
assert amazonWebService.getSns('eu-west-1').endpoint.toString() == 'https://sns.eu-west-1.amazonaws.com'
}
/**
* Sqs
*/
void testSqsClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSqsAsync().class == AmazonSQSAsyncClient
assert amazonWebService.getSqsAsync('eu-west-1').class == AmazonSQSAsyncClient
assert amazonWebService.getSqs().class == AmazonSQSClient
assert amazonWebService.getSqs('eu-west-1').class == AmazonSQSClient
assert amazonWebService.getSqs('eu-west-1').endpoint.toString() == 'https://sqs.eu-west-1.amazonaws.com'
}
void testSqsClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getSqsAsync().class == AmazonSQSAsyncClient
assert amazonWebService.getSqsAsync('eu-west-1').class == AmazonSQSAsyncClient
assert amazonWebService.getSqs().class == AmazonSQSClient
assert amazonWebService.getSqs('eu-west-1').class == AmazonSQSClient
assert amazonWebService.getSqs('eu-west-1').endpoint.toString() == 'https://sqs.eu-west-1.amazonaws.com'
}
/**
* SqsBuffered
*/
void testSqsBufferedClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSqsBufferedAsync().class == AmazonSQSBufferedAsyncClient
assert amazonWebService.getSqsBufferedAsync('eu-west-1').class == AmazonSQSBufferedAsyncClient
}
void testSqsBufferedClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getSqsBufferedAsync().class == AmazonSQSBufferedAsyncClient
assert amazonWebService.getSqsBufferedAsync('eu-west-1').class == AmazonSQSBufferedAsyncClient
}
/**
* StorageGateway
*/
void testStorageGatewayClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getStorageGatewayAsync().class == AWSStorageGatewayAsyncClient
assert amazonWebService.getStorageGatewayAsync('eu-west-1').class == AWSStorageGatewayAsyncClient
assert amazonWebService.getStorageGateway().class == AWSStorageGatewayClient
assert amazonWebService.getStorageGateway('eu-west-1').class == AWSStorageGatewayClient
assert amazonWebService.getStorageGateway('eu-west-1').endpoint.toString() == 'https://storagegateway.eu-west-1.amazonaws.com'
}
void testStorageGatewayClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getStorageGatewayAsync().class == AWSStorageGatewayAsyncClient
assert amazonWebService.getStorageGatewayAsync('eu-west-1').class == AWSStorageGatewayAsyncClient
assert amazonWebService.getStorageGateway().class == AWSStorageGatewayClient
assert amazonWebService.getStorageGateway('eu-west-1').class == AWSStorageGatewayClient
assert amazonWebService.getStorageGateway('eu-west-1').endpoint.toString() == 'https://storagegateway.eu-west-1.amazonaws.com'
}
/**
* Sts
*/
void testStsClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getStsAsync().class == AWSSecurityTokenServiceAsyncClient
assert amazonWebService.getStsAsync('eu-west-1').class == AWSSecurityTokenServiceAsyncClient
assert amazonWebService.getSts().class == AWSSecurityTokenServiceClient
assert amazonWebService.getSts('eu-west-1').class == AWSSecurityTokenServiceClient
assert amazonWebService.getSts('eu-west-1').endpoint.toString() == 'https://sts.amazonaws.com'
}
void testStsClientWithoutCredentials() {
def amazonWebService = getServiceWithoutCredentials()
assert amazonWebService.getStsAsync().class == AWSSecurityTokenServiceAsyncClient
assert amazonWebService.getStsAsync('eu-west-1').class == AWSSecurityTokenServiceAsyncClient
assert amazonWebService.getSts().class == AWSSecurityTokenServiceClient
assert amazonWebService.getSts('eu-west-1').class == AWSSecurityTokenServiceClient
assert amazonWebService.getSts('eu-west-1').endpoint.toString() == 'https://sts.amazonaws.com'
}
/**
* Swf
*/
void testSwfClientWithCredentials() {
def amazonWebService = getServiceWithCredentials()
assert amazonWebService.getSwfAsync().class == AmazonSimpleWorkflowAsyncClient
assert amazonWebService.getSwfAsync('eu-west-1').class == AmazonSimpleWorkflowAsyncClient
assert amazonWebService.getSwf().class == AmazonSimpleWorkflowClient
assert amazonWebService.getSwf('eu-west-1').class == AmazonSimpleWorkflowClient
assert amazonWebService.getSwf('eu-west-1').endpoint.toString() == 'https://swf.eu-west-1.amazonaws.com'
}
void testSwfClientWithoutCredentials() {