From 42dc6a92bc21ba64e6ddfa4151779d2b721b6fb1 Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Wed, 27 Sep 2023 14:06:47 +0200 Subject: [PATCH] glesys_emailalias acctest cleanup --- glesys/resource_glesys_emailalias_test.go | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/glesys/resource_glesys_emailalias_test.go b/glesys/resource_glesys_emailalias_test.go index f5e8518..03b20c7 100644 --- a/glesys/resource_glesys_emailalias_test.go +++ b/glesys/resource_glesys_emailalias_test.go @@ -19,16 +19,16 @@ func TestAccEmailAlias_basic(t *testing.T) { Providers: testGlesysProviders, Steps: []resource.TestStep{ { - Config: glesysEmailAliasSkeleton(newDomain, "goto = \""+rName+"@"+newDomain+"\""), + Config: glesysEmailAliasSkeleton(newDomain, fmt.Sprintf("goto = \"%s@%s\"", rName, newDomain)), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "emailalias", "alice@"+newDomain), - resource.TestCheckResourceAttr(name, "goto", rName+"@"+newDomain), + resource.TestCheckResourceAttr(name, "emailalias", fmt.Sprintf("alice@%s", newDomain)), + resource.TestCheckResourceAttr(name, "goto", fmt.Sprintf("%s@%s", rName, newDomain)), ), }, { - Config: glesysEmailAliasSkeleton(newDomain, "goto = \"kurt@"+newDomain+"\""), + Config: glesysEmailAliasSkeleton(newDomain, fmt.Sprintf("goto = \"kurt@%s\"", newDomain)), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "goto", "kurt@"+newDomain), + resource.TestCheckResourceAttr(name, "goto", fmt.Sprintf("kurt@%s", newDomain)), ), }, }, @@ -46,14 +46,3 @@ func glesysEmailAliasSkeleton(domain string, s string) string { %s }`, domain, s) } -func glesysEmailAliasUpdate(domain string, s string) string { - return fmt.Sprintf( - `resource "glesys_dnsdomain" "test" { - name = "%s" - } - - resource "glesys_emailalias" "test" { - emailalias = "alice@${glesys_dnsdomain.test.name}" - %s - }`, domain, s) -}