Skip to content

Commit 26c99a7

Browse files
toppercodesampagent
andcommitted
tests: fix acceptance regressions for token regenerate update
Amp-Thread-ID: https://ampcode.com/threads/T-019cb105-9ca1-77fd-86f5-da5b5605cb01 Co-authored-by: Amp <amp@ampcode.com>
1 parent 07aec28 commit 26c99a7

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

axiom/provider_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ func TestAccAxiomResources_capabilities(t *testing.T) {
375375
}
376376
}
377377
`,
378-
ExpectError: regexp.MustCompile(`at\sleast\sone\scapability\smust\sbe\sset`),
378+
ExpectError: regexp.MustCompile(`(?i)at\s+least\s+one\s+dataset\s+capability\s+must\s+be\s+set`),
379379
},
380380
{
381381
Config: `
@@ -747,6 +747,10 @@ func testAccCheckAxiomResourcesDestroyed(client *ax.Client) func(s *terraform.St
747747
case "axiom_virtual_field":
748748
_, err = client.VirtualFields.Get(context.Background(), resource.Primary.ID)
749749
}
750+
if err == nil {
751+
return fmt.Errorf("resource %s still exists after destroy", id)
752+
}
753+
750754
datasetErr, ok := err.(ax.HTTPError)
751755
if !ok {
752756
return fmt.Errorf("could not assert error for %s as ax.HTTPError: %T", id, err)

axiom/resource_tokens.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import (
1414
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
1515
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
1616
"github.com/hashicorp/terraform-plugin-framework/resource/schema/mapdefault"
17-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
18-
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1917
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
2018
"github.com/hashicorp/terraform-plugin-framework/types"
2119
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
@@ -130,16 +128,10 @@ func (r *TokenResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
130128
Computed: true,
131129
Sensitive: true,
132130
Description: "The token value to be used in API calls",
133-
PlanModifiers: []planmodifier.String{
134-
stringplanmodifier.UseStateForUnknown(),
135-
},
136131
},
137132
"id": schema.StringAttribute{
138133
Computed: true,
139134
MarkdownDescription: "The unique identifier of the token to be used when interacting with the token",
140-
PlanModifiers: []planmodifier.String{
141-
stringplanmodifier.UseStateForUnknown(),
142-
},
143135
},
144136
"name": schema.StringAttribute{
145137
Required: true,

0 commit comments

Comments
 (0)