Skip to content

Commit

Permalink
fix teams account acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssamw committed Apr 28, 2024
1 parent 122674e commit 7123675
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/sdkv2provider/resource_cloudflare_teams_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"strings"
"time"

"github.com/MakeNowJust/heredoc/v2"
"github.com/cloudflare/cloudflare-go"
Expand Down Expand Up @@ -508,10 +509,9 @@ func inflateExtendedEmailMatchingConfig(config interface{}) *cloudflare.TeamsExt

func flattenCustomCertificateConfig(config *cloudflare.TeamsCustomCertificate) []interface{} {
return []interface{}{map[string]interface{}{
"enabled": *config.Enabled,
"id": config.ID,
"binding_status": config.BindingStatus,
"updated_at": config.UpdatedAt,
"enabled": *config.Enabled,
"id": config.ID,
"updated_at": config.UpdatedAt.Format(time.RFC3339Nano),
}}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestAccCloudflareTeamsAccounts_ConfigurationBasic(t *testing.T) {
Config: testAccCloudflareTeamsAccountBasic(rnd, accountID),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(name, consts.AccountIDSchemaKey, accountID),
resource.TestCheckResourceAttr(name, "custom_certificate.0.enabled", "true"),
resource.TestCheckResourceAttr(name, "custom_certificate.0.enabled", "false"),
resource.TestCheckResourceAttr(name, "tls_decrypt_enabled", "true"),
resource.TestCheckResourceAttr(name, "protocol_detection_enabled", "true"),
resource.TestCheckResourceAttr(name, "activity_log_enabled", "true"),
Expand Down Expand Up @@ -137,7 +137,7 @@ resource "cloudflare_teams_account" "%[1]s" {
enabled = true
}
custom_certificate {
enabled = true
enabled = false
}
}
`, rnd, accountID)
Expand Down
4 changes: 4 additions & 0 deletions internal/sdkv2provider/schema_cloudflare_teams_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,8 @@ var customCertificateSchema = map[string]*schema.Schema{
Optional: true,
Description: "ID of custom certificate.",
},
"updated_at": {
Type: schema.TypeString,
Computed: true,
},
}

0 comments on commit 7123675

Please sign in to comment.