Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/mq: Add ErrorCheck #18164

Merged
merged 3 commits into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions aws/data_source_aws_mq_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ func TestAccDataSourceAWSMqBroker_basic(t *testing.T) {
resourceName := "aws_mq_broker.acctest"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(mq.EndpointsID, t) },
Providers: testAccProviders,
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(mq.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAWSMqBrokerConfig_byId(brokerName, prefix),
Expand Down
15 changes: 15 additions & 0 deletions aws/resource_aws_mq_broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func TestAccAWSMqBroker_basic(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -335,6 +336,7 @@ func TestAccAWSMqBroker_throughputOptimized(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -413,6 +415,7 @@ func TestAccAWSMqBroker_allFieldsDefaultVpc(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -536,6 +539,7 @@ func TestAccAWSMqBroker_allFieldsCustomVpc(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -647,6 +651,7 @@ func TestAccAWSMqBroker_EncryptionOptions_KmsKeyId(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -680,6 +685,7 @@ func TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled(t *testing.T)
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -712,6 +718,7 @@ func TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -744,6 +751,7 @@ func TestAccAWSMqBroker_updateUsers(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -816,6 +824,7 @@ func TestAccAWSMqBroker_tags(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -865,6 +874,7 @@ func TestAccAWSMqBroker_updateSecurityGroup(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -917,6 +927,7 @@ func TestAccAWSMqBroker_updateEngineVersion(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -955,6 +966,7 @@ func TestAccAWSMqBroker_disappears(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand All @@ -981,6 +993,7 @@ func TestAccAWSMqBroker_rabbitmq(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1018,6 +1031,7 @@ func TestAccAWSMqBroker_clusterRabbitMQ(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1078,6 +1092,7 @@ func TestAccAWSMqBroker_ldap(t *testing.T) {
testAccPartitionHasServicePreCheck(mq.EndpointsID, t)
testAccPreCheckAWSMq(t)
},
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqBrokerDestroy,
Steps: []resource.TestStep{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_mq_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) },
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqConfigurationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -60,6 +61,7 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) },
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqConfigurationDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -90,6 +92,7 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) },
ErrorCheck: testAccErrorCheck(t, mq.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsMqConfigurationDestroy,
Steps: []resource.TestStep{
Expand Down