Skip to content

Commit

Permalink
[fix]add test for AutoResolve location test
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqingzhang committed Jun 28, 2022
1 parent 7d4875b commit f12b975
Showing 1 changed file with 26 additions and 0 deletions.
Expand Up @@ -89,6 +89,20 @@ func TestAccSynapseIntegrationRuntimeAzure_update(t *testing.T) {
})
}

func TestAccSynapseIntegrationRuntimeAzure_location(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_synapse_integration_runtime_azure", "test")
r := IntegrationRuntimeAzureResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.location(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
})
}

func (r IntegrationRuntimeAzureResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := parse.IntegrationRuntimeID(state.ID)
if err != nil {
Expand All @@ -113,6 +127,18 @@ resource "azurerm_synapse_integration_runtime_azure" "test" {
`, r.template(data))
}

func (r IntegrationRuntimeAzureResource) location(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_synapse_integration_runtime_azure" "test" {
name = "azure-integration-runtime"
synapse_workspace_id = azurerm_synapse_workspace.test.id
location = "AutoResolve"
}
`, r.template(data))
}

func (r IntegrationRuntimeAzureResource) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
Expand Down

0 comments on commit f12b975

Please sign in to comment.