diff --git a/internal/sdkprovider/service/organization/organization_user_test.go b/internal/sdkprovider/service/organization/organization_user_test.go index bd3812261..97075ac7e 100644 --- a/internal/sdkprovider/service/organization/organization_user_test.go +++ b/internal/sdkprovider/service/organization/organization_user_test.go @@ -3,7 +3,7 @@ package organization_test import ( "context" "fmt" - "log" + "regexp" "testing" "github.com/aiven/aiven-go-client/v2" @@ -16,7 +16,6 @@ import ( ) func TestAccAivenOrganizationUser_basic(t *testing.T) { - resourceName := "aiven_organization_user.foo" rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) resource.ParallelTest(t, resource.TestCase{ @@ -26,12 +25,8 @@ func TestAccAivenOrganizationUser_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccOrganizationUserResource(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAivenOrganizationUserAttributes("data.aiven_organization_user.member"), - resource.TestCheckResourceAttr( - resourceName, "user_email", fmt.Sprintf("aleks+%s@aiven.io", rName), - ), - resource.TestCheckResourceAttr(resourceName, "accepted", "false"), + ExpectError: regexp.MustCompile( + "creation of organization user is not supported anymore via Terraform.*", ), }, }, @@ -101,34 +96,3 @@ func testAccCheckAivenOrganizationUserResourceDestroy(s *terraform.State) error return nil } - -func testAccCheckAivenOrganizationUserAttributes(n string) resource.TestCheckFunc { - return func(s *terraform.State) error { - r := s.RootModule().Resources[n] - a := r.Primary.Attributes - - log.Printf("[DEBUG] organization user attributes %v", a) - - if a["organization_id"] == "" { - return fmt.Errorf("expected to get an organization_id from Aiven") - } - - if a["user_email"] == "" { - return fmt.Errorf("expected to get a user_email from Aiven") - } - - if a["create_time"] == "" { - return fmt.Errorf("expected to get a create_time from Aiven") - } - - if a["accepted"] != "false" { - return fmt.Errorf("expected to get a accepted from Aiven") - } - - if a["invited_by"] == "" { - return fmt.Errorf("expected to get a invited_by from Aiven") - } - - return nil - } -}