Skip to content

Commit

Permalink
azurerm_logic_app_action_http - add test for body (#15377)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiqingzhang authored Feb 11, 2022
1 parent 6d975af commit 6c9e824
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions internal/services/logic/logic_app_action_http_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ func TestAccLogicAppActionHttp_basic(t *testing.T) {
})
}

func TestAccLogicAppActionHttp_complete(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_logic_app_action_http", "test")
r := LogicAppActionHttpResource{}

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

func TestAccLogicAppActionHttp_requiresImport(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_logic_app_action_http", "test")
r := LogicAppActionHttpResource{}
Expand Down Expand Up @@ -123,6 +138,33 @@ resource "azurerm_logic_app_action_http" "test" {
`, r.template(data), data.RandomInteger)
}

func (r LogicAppActionHttpResource) complete(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_logic_app_action_http" "test" {
name = "action%d"
logic_app_id = azurerm_logic_app_workflow.test.id
method = "GET"
uri = "http://example.com/hello"
body = <<BODY
{
"description": "test description",
"inputs": {
"variables": [
{
"name": "test name",
"type": "Integer",
"value": 1
}
]
}
}
BODY
}
`, r.template(data), data.RandomInteger)
}

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

0 comments on commit 6c9e824

Please sign in to comment.