From 7d44f7eb3980020f778cdd270c1d53f94468e4bf Mon Sep 17 00:00:00 2001 From: jackofallops <11830746+jackofallops@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:33:40 +0100 Subject: [PATCH] `servicenetworking` - fixup test checks (#23410) --- .../application_load_balancer_resource_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/services/servicenetworking/application_load_balancer_resource_test.go b/internal/services/servicenetworking/application_load_balancer_resource_test.go index 3391fb835035..683683f2a44a 100644 --- a/internal/services/servicenetworking/application_load_balancer_resource_test.go +++ b/internal/services/servicenetworking/application_load_balancer_resource_test.go @@ -3,6 +3,7 @@ package servicenetworking_test import ( "context" "fmt" + "regexp" "testing" "github.com/hashicorp/go-azure-helpers/lang/pointer" @@ -41,7 +42,7 @@ func TestAccApplicationLoadBalancer_basic(t *testing.T) { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("configuration_endpoint.#").HasValue("1"), + check.That(data.ResourceName).Key("primary_configuration_endpoint").MatchesRegex(regexp.MustCompile(`^.+\.alb.azure.com$`)), ), }, data.ImportStep(), @@ -57,7 +58,7 @@ func TestAccApplicationLoadBalancer_complete(t *testing.T) { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("primary_configuration_endpoint").HasValue("1"), + check.That(data.ResourceName).Key("primary_configuration_endpoint").MatchesRegex(regexp.MustCompile(`^.+\.alb.azure.com$`)), ), }, data.ImportStep(), @@ -73,7 +74,7 @@ func TestAccApplicationLoadBalancer_update(t *testing.T) { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("configuration_endpoint.#").HasValue("1"), + check.That(data.ResourceName).Key("primary_configuration_endpoint").MatchesRegex(regexp.MustCompile(`^.+\.alb.azure.com$`)), ), }, data.ImportStep(), @@ -81,7 +82,7 @@ func TestAccApplicationLoadBalancer_update(t *testing.T) { Config: r.complete(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("configuration_endpoint.#").HasValue("1"), + check.That(data.ResourceName).Key("primary_configuration_endpoint").MatchesRegex(regexp.MustCompile(`^.+\.alb.azure.com$`)), ), }, data.ImportStep(), @@ -97,7 +98,7 @@ func TestAccApplicationLoadBalancer_requiresImport(t *testing.T) { Config: r.basic(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("configuration_endpoint.#").HasValue("1"), + check.That(data.ResourceName).Key("primary_configuration_endpoint").MatchesRegex(regexp.MustCompile(`^.+\.alb.azure.com$`)), ), }, data.RequiresImportErrorStep(r.requiresImport),