@ -58,10 +58,10 @@ func TestAccAzureRMServiceBusTopic_update(t *testing.T) {
} )
}
func TestAccAzureRMServiceBusTopic_enablePartitioning ( t * testing . T ) {
func TestAccAzureRMServiceBusTopic_enablePartitioning Standard ( t * testing . T ) {
ri := acctest . RandInt ( )
preConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_basic , ri , ri , ri )
postConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_enablePartitioning , ri , ri , ri )
postConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_enablePartitioning Standard , ri , ri , ri )
resource . Test ( t , resource . TestCase {
PreCheck : func ( ) { testAccPreCheck ( t ) } ,
@ -88,6 +88,35 @@ func TestAccAzureRMServiceBusTopic_enablePartitioning(t *testing.T) {
} )
}
func TestAccAzureRMServiceBusTopic_enablePartitioningPremium ( t * testing . T ) {
ri := acctest . RandInt ( )
preConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_basic , ri , ri , ri )
postConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_enablePartitioningPremium , ri , ri , ri )
resource . Test ( t , resource . TestCase {
PreCheck : func ( ) { testAccPreCheck ( t ) } ,
Providers : testAccProviders ,
CheckDestroy : testCheckAzureRMServiceBusTopicDestroy ,
Steps : [ ] resource . TestStep {
resource . TestStep {
Config : preConfig ,
Check : resource . ComposeTestCheckFunc (
testCheckAzureRMServiceBusTopicExists ( "azurerm_servicebus_topic.test" ) ,
) ,
} ,
resource . TestStep {
Config : postConfig ,
Check : resource . ComposeTestCheckFunc (
resource . TestCheckResourceAttr (
"azurerm_servicebus_topic.test" , "enable_partitioning" , "true" ) ,
resource . TestCheckResourceAttr (
"azurerm_servicebus_topic.test" , "max_size_in_megabytes" , "81920" ) ,
) ,
} ,
} ,
} )
}
func TestAccAzureRMServiceBusTopic_enableDuplicateDetection ( t * testing . T ) {
ri := acctest . RandInt ( )
preConfig := fmt . Sprintf ( testAccAzureRMServiceBusTopic_basic , ri , ri , ri )
@ -194,6 +223,27 @@ resource "azurerm_servicebus_topic" "test" {
}
`
var testAccAzureRMServiceBusTopic_basicPremium = `
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "azurerm_servicebus_namespace" "test" {
name = "acctestservicebusnamespace-%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "premium"
}
resource "azurerm_servicebus_topic" "test" {
name = "acctestservicebustopic-%d"
location = "West US"
namespace_name = "${azurerm_servicebus_namespace.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
}
`
var testAccAzureRMServiceBusTopic_update = `
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
@ -217,7 +267,7 @@ resource "azurerm_servicebus_topic" "test" {
}
`
var testAccAzureRMServiceBusTopic_enablePartitioning = `
var testAccAzureRMServiceBusTopic_enablePartitioning Standard = `
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "West US"
@ -240,6 +290,29 @@ resource "azurerm_servicebus_topic" "test" {
}
`
var testAccAzureRMServiceBusTopic_enablePartitioningPremium = `
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "West US"
}
resource "azurerm_servicebus_namespace" "test" {
name = "acctestservicebusnamespace-%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "premium"
}
resource "azurerm_servicebus_topic" "test" {
name = "acctestservicebustopic-%d"
location = "West US"
namespace_name = "${azurerm_servicebus_namespace.test.name}"
resource_group_name = "${azurerm_resource_group.test.name}"
enable_partitioning = true
max_size_in_megabytes = 81920
}
`
var testAccAzureRMServiceBusTopic_enableDuplicateDetection = `
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"