forked from hashicorp/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappsync_test.go
127 lines (119 loc) · 6.31 KB
/
appsync_test.go
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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package appsync_test
import (
"os"
"testing"
"github.com/hashicorp/terraform-provider-aws/internal/acctest"
)
func TestAccAppSync_serial(t *testing.T) {
t.Parallel()
testCases := map[string]map[string]func(t *testing.T){
"APIKey": {
"basic": testAccAPIKey_basic,
"description": testAccAPIKey_description,
"expires": testAccAPIKey_expires,
},
"DataSource": {
"basic": testAccDataSource_basic,
"description": testAccDataSource_description,
"DynamoDB_region": testAccDataSource_DynamoDB_region,
"DynamoDB_useCallerCredentials": testAccDataSource_DynamoDB_useCallerCredentials,
"HTTP_endpoint": testAccDataSource_HTTP_endpoint,
"type": testAccDataSource_type,
"Type_dynamoDB": testAccDataSource_Type_dynamoDB,
"Type_http": testAccDataSource_Type_http,
"Type_http_auth": testAccDataSource_Type_httpAuth,
"Type_lambda": testAccDataSource_Type_lambda,
"Type_none": testAccDataSource_Type_none,
"Type_rdbms": testAccDataSource_Type_relationalDatabase,
"Type_rdbms_options": testAccDataSource_Type_relationalDatabaseWithOptions,
"Type_eventBridge": testAccDataSource_Type_eventBridge,
},
"GraphQLAPI": {
"basic": testAccGraphQLAPI_basic,
"disappears": testAccGraphQLAPI_disappears,
"tags": testAccGraphQLAPI_tags,
"schema": testAccGraphQLAPI_schema,
"authenticationType": testAccGraphQLAPI_authenticationType,
"AuthenticationType_apiKey": testAccGraphQLAPI_AuthenticationType_apiKey,
"AuthenticationType_awsIAM": testAccGraphQLAPI_AuthenticationType_iam,
"AuthenticationType_amazonCognitoUserPools": testAccGraphQLAPI_AuthenticationType_amazonCognitoUserPools,
"AuthenticationType_openIDConnect": testAccGraphQLAPI_AuthenticationType_openIDConnect,
"AuthenticationType_awsLambda": testAccGraphQLAPI_AuthenticationType_lambda,
"log": testAccGraphQLAPI_log,
"Log_fieldLogLevel": testAccGraphQLAPI_Log_fieldLogLevel,
"Log_excludeVerboseContent": testAccGraphQLAPI_Log_excludeVerboseContent,
"OpenIDConnect_authTTL": testAccGraphQLAPI_OpenIDConnect_authTTL,
"OpenIDConnect_clientID": testAccGraphQLAPI_OpenIDConnect_clientID,
"OpenIDConnect_iatTTL": testAccGraphQLAPI_OpenIDConnect_iatTTL,
"OpenIDConnect_issuer": testAccGraphQLAPI_OpenIDConnect_issuer,
"name": testAccGraphQLAPI_name,
"UserPool_awsRegion": testAccGraphQLAPI_UserPool_region,
"UserPool_defaultAction": testAccGraphQLAPI_UserPool_defaultAction,
"LambdaAuthorizerConfig_authorizerUri": testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerURI,
"LambdaAuthorizerConfig_identityValidationExpression": testAccGraphQLAPI_LambdaAuthorizerConfig_identityValidationExpression,
"LambdaAuthorizerConfig_authorizerResultTtlInSeconds": testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerResultTTLInSeconds,
"AdditionalAuthentication_apiKey": testAccGraphQLAPI_AdditionalAuthentication_apiKey,
"AdditionalAuthentication_awsIAM": testAccGraphQLAPI_AdditionalAuthentication_iam,
"AdditionalAuthentication_cognitoUserPools": testAccGraphQLAPI_AdditionalAuthentication_cognitoUserPools,
"AdditionalAuthentication_openIDConnect": testAccGraphQLAPI_AdditionalAuthentication_openIDConnect,
"AdditionalAuthentication_awsLambda": testAccGraphQLAPI_AdditionalAuthentication_lambda,
"AdditionalAuthentication_multiple": testAccGraphQLAPI_AdditionalAuthentication_multiple,
"xrayEnabled": testAccGraphQLAPI_xrayEnabled,
"visibility": testAccGraphQLAPI_visibility,
"introspectionConfig": testAccGraphQLAPI_introspectionConfig,
"queryDepthLimit": testAccGraphQLAPI_queryDepthLimit,
"resolverCountLimit": testAccGraphQLAPI_resolverCountLimit,
},
"Function": {
"basic": testAccFunction_basic,
"code": testAccFunction_code,
"disappears": testAccFunction_disappears,
"description": testAccFunction_description,
"responseMappingTemplate": testAccFunction_responseMappingTemplate,
"sync": testAccFunction_syncConfig,
},
"Resolver": {
"basic": testAccResolver_basic,
"code": testAccResolver_code,
"disappears": testAccResolver_disappears,
"dataSource": testAccResolver_dataSource,
"DataSource_lambda": testAccResolver_DataSource_lambda,
"requestTemplate": testAccResolver_requestTemplate,
"responseTemplate": testAccResolver_responseTemplate,
"multipleResolvers": testAccResolver_multipleResolvers,
"pipeline": testAccResolver_pipeline,
"caching": testAccResolver_caching,
"sync": testAccResolver_syncConfig,
},
"ApiCache": {
"basic": testAccAPICache_basic,
"disappears": testAccAPICache_disappears,
},
"Type": {
"basic": testAccType_basic,
"disappears": testAccType_disappears,
},
"DomainName": {
"basic": testAccDomainName_basic,
"disappears": testAccDomainName_disappears,
"description": testAccDomainName_description,
},
"DomainNameAssociation": {
"basic": testAccDomainNameAPIAssociation_basic,
"disappears": testAccDomainNameAPIAssociation_disappears,
},
}
acctest.RunSerialTests2Levels(t, testCases, 0)
}
func getCertDomain(t *testing.T) string {
value := os.Getenv("AWS_APPSYNC_DOMAIN_NAME_CERTIFICATE_DOMAIN")
if value == "" {
t.Skip(
"Environment variable AWS_APPSYNC_DOMAIN_NAME_CERTIFICATE_DOMAIN is not set. " +
"This environment variable must be set to any non-empty value " +
"to enable the test.")
}
return value
}