package iam import ( "testing" "github.com/stretchr/testify/assert" "google.golang.org/api/iam/v1" ) const ( displayName = "test-sa" description = "Test Service Account" accountID = "test-account-id" ) func TestNewServiceAccount(t *testing.T) { expectedSa := &iam.ServiceAccount{ DisplayName: displayName, Description: description, } actualSa := NewServiceAccount(displayName, description) assert.Equal(t, expectedSa, actualSa) } func TestNewServiceAccountRequest(t *testing.T) { sa := NewServiceAccount(displayName, description) expectedSARequest := &iam.CreateServiceAccountRequest{ AccountId: accountID, ServiceAccount: sa, } actualSARequest := NewServiceAccountRequest(accountID, sa) assert.Equal(t, expectedSARequest, actualSARequest) } func TestNewServiceAccountKey(t *testing.T) { expectedSAKey := &iam.CreateServiceAccountKeyRequest{} actualSAKey := NewServiceAccountKeyRequest() assert.Equal(t, expectedSAKey, actualSAKey) }