Skip to content

Commit

Permalink
Adapt test to run with MSI authentication mode
Browse files Browse the repository at this point in the history
  • Loading branch information
marcgs committed Jan 24, 2023
1 parent dae10b0 commit 5b9eb5b
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ func TestAccStreamAnalyticsOutputServiceBusTopic_requiresImport(t *testing.T) {
})
}

func TestAccStreamAnalyticsOutputServiceBusTopic_authenticationMode(t *testing.T) {
func TestAccStreamAnalyticsOutputServiceBusTopic_authenticationModeMsi(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_servicebus_topic", "test")
r := StreamAnalyticsOutputServiceBusTopicResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.json(data),
Config: r.authenticationModeMsi(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
Expand Down Expand Up @@ -248,6 +248,28 @@ resource "azurerm_stream_analytics_output_servicebus_topic" "test" {
`, template, data.RandomInteger)
}

func (r StreamAnalyticsOutputServiceBusTopicResource) authenticationModeMsi(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
%s
resource "azurerm_stream_analytics_output_servicebus_topic" "test" {
name = "acctestinput-%d"
stream_analytics_job_name = azurerm_stream_analytics_job.test.name
resource_group_name = azurerm_stream_analytics_job.test.resource_group_name
topic_name = azurerm_servicebus_topic.test.name
servicebus_namespace = azurerm_servicebus_namespace.test.name
authentication_mode = "Msi"
serialization {
type = "Json"
encoding = "UTF8"
format = "LineSeparated"
}
}
`, template, data.RandomInteger)
}

func (r StreamAnalyticsOutputServiceBusTopicResource) propertyColumns(data acceptance.TestData) string {
template := r.template(data)
return fmt.Sprintf(`
Expand Down

0 comments on commit 5b9eb5b

Please sign in to comment.