Skip to content

Commit

Permalink
Merge pull request #5833 from terraform-providers/api-management-api-…
Browse files Browse the repository at this point in the history
…path-blank

`azurerm_api_management_api` - Test for Blank Path
  • Loading branch information
jackofallops authored Feb 21, 2020
2 parents cd303d4 + 49a51a7 commit 41292b0
Showing 1 changed file with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,29 @@ func TestAccAzureRMApiManagementApi_wordRevision(t *testing.T) {
})
}

func TestAccAzureRMApiManagementApi_blankPath(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_api_management_api", "test")

resource.Test(t, resource.TestCase{
PreCheck: func() { acceptance.PreCheck(t) },
Providers: acceptance.SupportedProviders,
CheckDestroy: testCheckAzureRMApiManagementApiDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMApiManagementApi_blankPath(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMApiManagementApiExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "soap_pass_through", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "is_current", "true"),
resource.TestCheckResourceAttr(data.ResourceName, "is_online", "false"),
resource.TestCheckResourceAttr(data.ResourceName, "path", ""),
),
},
data.ImportStep(),
},
})
}

func TestAccAzureRMApiManagementApi_version(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_api_management_api", "test")

Expand Down Expand Up @@ -349,6 +372,23 @@ resource "azurerm_api_management_api" "test" {
`, template, data.RandomInteger)
}

func testAccAzureRMApiManagementApi_blankPath(data acceptance.TestData) string {
template := testAccAzureRMApiManagementApi_template(data)
return fmt.Sprintf(`
%s
resource "azurerm_api_management_api" "test" {
name = "acctestapi-%d"
resource_group_name = "${azurerm_resource_group.test.name}"
api_management_name = "${azurerm_api_management.test.name}"
display_name = "api1"
path = ""
protocols = ["https"]
revision = "1"
}
`, template, data.RandomInteger)
}

func testAccAzureRMApiManagementApi_wordRevision(data acceptance.TestData) string {
template := testAccAzureRMApiManagementApi_template(data)
return fmt.Sprintf(`
Expand Down

0 comments on commit 41292b0

Please sign in to comment.