Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(swo_uri): Fix acceptance test for uri resource #87

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions internal/provider/uri_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func TestAccUriResource(t *testing.T) {
Steps: []resource.TestStep{
// Create and Read testing
{
Config: testAccUriResourceConfig("test one"),
Config: testAccUriResourceConfig("test-acc test one"),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet("swo_uri.test", "id"),
resource.TestCheckResourceAttr("swo_uri.test", "name", "test one"),
resource.TestCheckResourceAttr("swo_uri.test", "host", "www.solarwinds.com"),
resource.TestCheckResourceAttr("swo_uri.test", "options.is_ping_enabled", "true"),
resource.TestCheckResourceAttr("swo_uri.test", "options.is_tcp_enabled", "false"),
resource.TestCheckResourceAttr("swo_uri.test", "name", "test-acc test one"),
resource.TestCheckResourceAttr("swo_uri.test", "host", "example.com"),
resource.TestCheckResourceAttr("swo_uri.test", "options.is_ping_enabled", "false"),
resource.TestCheckResourceAttr("swo_uri.test", "options.is_tcp_enabled", "true"),
),
},
// ImportState testing
Expand All @@ -32,9 +32,9 @@ func TestAccUriResource(t *testing.T) {
},
// Update and Read testing
{
Config: testAccUriResourceConfig("test two"),
Config: testAccUriResourceConfig("test-acc test two"),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("swo_uri.test", "name", "test two"),
resource.TestCheckResourceAttr("swo_uri.test", "name", "test-acc test two"),
),
},
// Delete testing automatically occurs in TestCase
Expand All @@ -44,13 +44,13 @@ func TestAccUriResource(t *testing.T) {

func testAccUriResourceConfig(name string) string {
return providerConfig() + fmt.Sprintf(`
resource "swo_uri" "test_uri" {
resource "swo_uri" "test" {
name = %[1]q
host = "https://example.com"
host = "example.com"

options = {
is_ping_enabled = true
is_tcp_enabled = false
is_ping_enabled = false
is_tcp_enabled = true
}

tcp_options = {
Expand Down