mirror of
https://github.com/ysoftdevs/terraform-provider-bitbucketserver.git
synced 2026-04-17 22:39:38 +02:00
Implement data source bitbucketserver_user
This commit is contained in:
31
bitbucket/data_user_test.go
Normal file
31
bitbucket/data_user_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package bitbucket
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccBitbucketDataUser(t *testing.T) {
|
||||
config := `
|
||||
data "bitbucketserver_user" "test" {
|
||||
name = "admin"
|
||||
}
|
||||
`
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: config,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
resource.TestCheckResourceAttr("data.bitbucketserver_user.test", "name", "admin"),
|
||||
resource.TestCheckResourceAttr("data.bitbucketserver_user.test", "email_address", "admin@example.com"),
|
||||
resource.TestCheckResourceAttr("data.bitbucketserver_user.test", "display_name", "Admin"),
|
||||
resource.TestCheckResourceAttr("data.bitbucketserver_user.test", "user_id", "1"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user