Files
paralus/pkg/service/kubectl_cluster_setting_test.go
Abin Simon df810ab45a Convert from dao interface to funcs
This was done inorder to support transactions which will be done in
the next PR. This is the first step towards that.
2022-03-16 17:10:32 +05:30

28 lines
578 B
Go

package service
import (
"context"
"testing"
"github.com/DATA-DOG/go-sqlmock"
"github.com/google/uuid"
)
func TestGetKubectlSetting(t *testing.T) {
db, mock := getDB(t)
defer db.Close()
ps := NewkubectlClusterSettingsService(db)
ouuid := uuid.New().String()
cuuid := uuid.New().String()
mock.ExpectQuery(`SELECT "kc"."name", "kc"."organization_id"`).
WithArgs().WillReturnRows(sqlmock.NewRows([]string{"name"}).AddRow("kcs-" + ouuid))
_, err := ps.Get(context.Background(), ouuid, cuuid)
if err != nil {
t.Fatal("could not get KubectlSetting:", err)
}
}