Skip to content

Commit

Permalink
fix(tests): change to expected error message in provider region integ…
Browse files Browse the repository at this point in the history
…ration test (#2473)
  • Loading branch information
pranav-new-relic authored Sep 20, 2023
1 parent b3e0b4a commit 9ab53fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions newrelic/provider_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func TestAccNewRelicProvider_Region(t *testing.T) {
// This error message will occur when configuring
// US region with EU API URLs when using the TF test account.
expectedErrorMsg := "403 response returned"
expectedErrorMsgTwo := "Access denied."
expectedErrorMsgRegex := fmt.Sprintf("%s|%s", expectedErrorMsg, expectedErrorMsgTwo)
rName := acctest.RandString(5)

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -43,12 +45,12 @@ func TestAccNewRelicProvider_Region(t *testing.T) {
// Test: Region "EU"
{
Config: testAccNewRelicProviderConfig("EU", "", rName),
ExpectError: regexp.MustCompile(expectedErrorMsg),
ExpectError: regexp.MustCompile(expectedErrorMsgRegex),
},
// Test: Override US region URLs with EU region URLs (will result in an auth error)
{
Config: testAccNewRelicProviderConfig("US", `nerdgraph_api_url = "https://api.eu.newrelic.com/graphql"`, rName),
ExpectError: regexp.MustCompile(expectedErrorMsg),
ExpectError: regexp.MustCompile(expectedErrorMsgRegex),
},
// Test: Override EU region URLs with US region URLs (should work since the TF acct is US-based)
{
Expand Down

0 comments on commit 9ab53fb

Please sign in to comment.