Skip to content

Commit

Permalink
servicenetworking - fixup test checks (hashicorp#23410)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops authored Sep 28, 2023
1 parent f93d250 commit 7d44f7e
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package servicenetworking_test
import (
"context"
"fmt"
"regexp"
"testing"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
Expand Down Expand Up @@ -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(),
Expand All @@ -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(),
Expand All @@ -73,15 +74,15 @@ 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(),
{
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(),
Expand All @@ -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),
Expand Down

0 comments on commit 7d44f7e

Please sign in to comment.