Skip to content

Commit

Permalink
added default state importer for bitbucket_datacenter_integration
Browse files Browse the repository at this point in the history
added test for import bitbucket-datacenter resource
  • Loading branch information
mplushnikov authored and truszkowski committed Mar 19, 2024
1 parent 4e1dd29 commit 2f08e89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spacelift/resource_bitbucket_datacenter_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func resourceBitbucketDatacenterIntegration() *schema.Resource {
ReadContext: resourceBitbucketDatacenterIntegrationRead,
UpdateContext: resourceBitbucketDatacenterIntegrationUpdate,
DeleteContext: resourceBitbucketDatacenterIntegrationDelete,
Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: map[string]*schema.Schema{
bitbucketDatacenterID: {
Expand Down
6 changes: 6 additions & 0 deletions spacelift/resource_bitbucket_datacenter_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func TestBitbucketDatacenterIntegrationResource(t *testing.T) {
Attribute("labels.#", Equals("0")),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"access_token"}, // specified only in the config
},
{
Config: configBitbucket("newUserName", host, token, "new descr", `["new label1"]`),
Check: Resource(
Expand Down

0 comments on commit 2f08e89

Please sign in to comment.