Skip to content

Commit

Permalink
azurerm_eventhub_namespace: allow maximum_throughput_units to be zero…
Browse files Browse the repository at this point in the history
… & some cleanup (#2124)
  • Loading branch information
katbyte authored and tombuildsstuff committed Oct 30, 2018
1 parent d2e769a commit 87ed6eb
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 238 deletions.
50 changes: 0 additions & 50 deletions azurerm/import_arm_eventgrid_topic_test.go

This file was deleted.

56 changes: 0 additions & 56 deletions azurerm/import_arm_eventhub_consumer_group_test.go

This file was deleted.

31 changes: 0 additions & 31 deletions azurerm/import_arm_eventhub_namespace_test.go

This file was deleted.

57 changes: 0 additions & 57 deletions azurerm/import_arm_eventhub_test.go

This file was deleted.

16 changes: 12 additions & 4 deletions azurerm/resource_arm_eventgrid_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,41 @@ import (
func TestAccAzureRMEventGridTopic_basic(t *testing.T) {
resourceName := "azurerm_eventgrid_topic.test"
ri := acctest.RandInt()
config := testAccAzureRMEventGridTopic_basic(ri)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMEventGridTopicDestroy,
Steps: []resource.TestStep{
{
Config: config,
Config: testAccAzureRMEventGridTopic_basic(ri),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventGridTopicExists(resourceName),
resource.TestCheckResourceAttrSet(resourceName, "endpoint"),
resource.TestCheckResourceAttrSet(resourceName, "primary_access_key"),
resource.TestCheckResourceAttrSet(resourceName, "secondary_access_key"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMEventGridTopic_basicWithTags(t *testing.T) {
resourceName := "azurerm_eventgrid_topic.test"
ri := acctest.RandInt()
config := testAccAzureRMEventGridTopic_basicWithTags(ri)

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMEventGridTopicDestroy,
Steps: []resource.TestStep{
{
Config: config,
Config: testAccAzureRMEventGridTopic_basicWithTags(ri),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventGridTopicExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
Expand All @@ -55,6 +58,11 @@ func TestAccAzureRMEventGridTopic_basicWithTags(t *testing.T) {
resource.TestCheckResourceAttrSet(resourceName, "secondary_access_key"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down
35 changes: 23 additions & 12 deletions azurerm/resource_arm_eventhub_consumer_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,80 @@ import (
)

func TestAccAzureRMEventHubConsumerGroup_basic(t *testing.T) {

resourceName := "azurerm_eventhub_consumer_group.test"
ri := acctest.RandInt()
config := testAccAzureRMEventHubConsumerGroup_basic(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMEventHubConsumerGroupDestroy,
Steps: []resource.TestStep{
{
Config: config,
Config: testAccAzureRMEventHubConsumerGroup_basic(ri, testLocation()),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventHubConsumerGroupExists("azurerm_eventhub_consumer_group.test"),
testCheckAzureRMEventHubConsumerGroupExists(resourceName),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMEventHubConsumerGroup_complete(t *testing.T) {

resourceName := "azurerm_eventhub_consumer_group.test"
ri := acctest.RandInt()
config := testAccAzureRMEventHubConsumerGroup_complete(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMEventHubConsumerGroupDestroy,
Steps: []resource.TestStep{
{
Config: config,
Config: testAccAzureRMEventHubConsumerGroup_complete(ri, testLocation()),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventHubConsumerGroupExists("azurerm_eventhub_consumer_group.test"),
testCheckAzureRMEventHubConsumerGroupExists(resourceName),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMEventHubConsumerGroup_userMetadataUpdate(t *testing.T) {
resourceName := "azurerm_eventhub_consumer_group.test"
ri := acctest.RandInt()
preConfig := testAccAzureRMEventHubConsumerGroup_basic(ri, testLocation())
postConfig := testAccAzureRMEventHubConsumerGroup_complete(ri, testLocation())

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMEventHubConsumerGroupDestroy,
Steps: []resource.TestStep{
{
Config: preConfig,
Config: testAccAzureRMEventHubConsumerGroup_basic(ri, testLocation()),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventHubConsumerGroupExists(resourceName),
),
},
{
Config: postConfig,
Config: testAccAzureRMEventHubConsumerGroup_complete(ri, testLocation()),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMEventHubConsumerGroupExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "user_metadata", "some-meta-data"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down
Loading

0 comments on commit 87ed6eb

Please sign in to comment.