Skip to content

Commit 0091100

Browse files
akinrosslhercot
authored andcommitted
[ignore] fix test for escape_html in aci_rest_managed to avoid < and > invalid characters for api to escape
1 parent a97ed90 commit 0091100

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

internal/provider/resource_aci_rest_managed_test.go

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestAccAciRestManaged_escapeHtml(t *testing.T) {
8585
{
8686
Config: testAccAciRestManagedConfig_escapeHtml(),
8787
Check: resource.ComposeTestCheckFunc(
88-
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "content.message", "<<< WARNING >>> VERIFYING THE CONVERSION OF HTML CHARACTERS."),
88+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "content.message", "&&& WARNING &&& VERIFYING THE CONVERSION OF HTML CHARACTERS."),
8989
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "escape_html", "false"),
9090
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "dn", "uni/userext/preloginbanner"),
9191
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "annotation", "orchestrator:terraform"),
@@ -96,6 +96,26 @@ func TestAccAciRestManaged_escapeHtml(t *testing.T) {
9696
})
9797
}
9898

99+
func TestAccAciRestManaged_escapeHtmlTrue(t *testing.T) {
100+
resource.Test(t, resource.TestCase{
101+
PreCheck: func() { testAccPreCheck(t, "both", "5.2(7g)") },
102+
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
103+
Steps: []resource.TestStep{
104+
{
105+
ExpectNonEmptyPlan: true,
106+
Config: testAccAciRestManagedConfig_escapeHtmlTrue(),
107+
Check: resource.ComposeTestCheckFunc(
108+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "content.message", "&&& WARNING &&& VERIFYING THE CONVERSION OF HTML CHARACTERS."),
109+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "escape_html", "true"),
110+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "dn", "uni/userext/preloginbanner"),
111+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "annotation", "orchestrator:terraform"),
112+
resource.TestCheckResourceAttr("aci_rest_managed.aaaPreLoginBanner", "class_name", "aaaPreLoginBanner"),
113+
),
114+
},
115+
},
116+
})
117+
}
118+
99119
func TestAccAciRestManaged_noContent(t *testing.T) {
100120
resource.Test(t, resource.TestCase{
101121
PreCheck: func() { testAccPreCheck(t, "both", "5.2(7g)") },
@@ -1191,7 +1211,20 @@ func testAccAciRestManagedConfig_escapeHtml() string {
11911211
class_name = "aaaPreLoginBanner"
11921212
escape_html = false
11931213
content = {
1194-
message = "<<< WARNING >>> VERIFYING THE CONVERSION OF HTML CHARACTERS."
1214+
message = "&&& WARNING &&& VERIFYING THE CONVERSION OF HTML CHARACTERS."
1215+
}
1216+
}
1217+
`
1218+
}
1219+
1220+
func testAccAciRestManagedConfig_escapeHtmlTrue() string {
1221+
return `
1222+
resource "aci_rest_managed" "aaaPreLoginBanner" {
1223+
dn = "uni/userext/preloginbanner"
1224+
class_name = "aaaPreLoginBanner"
1225+
escape_html = true
1226+
content = {
1227+
message = "&&& WARNING &&& VERIFYING THE CONVERSION OF HTML CHARACTERS."
11951228
}
11961229
}
11971230
`

0 commit comments

Comments
 (0)