From 55a458b426b23f3bc7afc586cd0ad06d4482792b Mon Sep 17 00:00:00 2001 From: YannC Date: Wed, 4 Dec 2024 10:26:02 +0100 Subject: [PATCH] fix(): tests --- internal/provider/resource_binding_test.go | 4 ++-- internal/provider/resource_user_test.go | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/provider/resource_binding_test.go b/internal/provider/resource_binding_test.go index 33ed9d9..68c4a98 100644 --- a/internal/provider/resource_binding_test.go +++ b/internal/provider/resource_binding_test.go @@ -19,7 +19,7 @@ func TestAccBinding(t *testing.T) { "kestra_binding.new", "type", "GROUP", ), resource.TestCheckResourceAttr( - "kestra_binding.new", "external_id", "admin", + "kestra_binding.new", "external_id", "admin_default", ), resource.TestCheckResourceAttr( "kestra_binding.new", "role_id", "admin", @@ -30,7 +30,7 @@ func TestAccBinding(t *testing.T) { ), }, { - Config: testAccResourceBinding("USER", "john", "admin2", "", "new"), + Config: testAccResourceBinding("USER", "john", "launcher_default", "", "new"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "kestra_binding.new", "type", "USER", diff --git a/internal/provider/resource_user_test.go b/internal/provider/resource_user_test.go index 06d6afd..0e7bcf4 100644 --- a/internal/provider/resource_user_test.go +++ b/internal/provider/resource_user_test.go @@ -15,13 +15,12 @@ func TestAccUser(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccResourceUser( - "admin", "admin@john.doe", "[kestra_group.group1.id]", ), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( - "kestra_user.new", "username", "admin", + "kestra_user.new", "username", "admin@john.doe", ), resource.TestCheckResourceAttr( "kestra_user.new", "email", "admin@john.doe", @@ -33,7 +32,6 @@ func TestAccUser(t *testing.T) { }, { Config: testAccResourceUser( - "admin-2", "admin2@john.doe", "[]", ), @@ -58,7 +56,7 @@ func TestAccUser(t *testing.T) { }) } -func testAccResourceUser(name, email, groups string) string { +func testAccResourceUser(email, groups string) string { return fmt.Sprintf( ` resource "kestra_role" "new" { @@ -82,7 +80,7 @@ func testAccResourceUser(name, email, groups string) string { email = "%s" groups = %s }`, - name, + email, email, groups, )