milvus/internal/metastore/model/credential_test.go
jaime 9672eae62c
Unify metastore catalog interface (#17772)
Signed-off-by: yun.zhang <yun.zhang@zilliz.com>
2022-07-22 10:20:29 +08:00

35 lines
708 B
Go

package model
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/milvus-io/milvus/internal/proto/internalpb"
)
var (
credentialModel = &Credential{
Username: "user",
EncryptedPassword: "password",
Tenant: "tenant-1",
IsSuper: true,
Sha256Password: "xxxx",
}
credentialPb = &internalpb.CredentialInfo{
Username: "user",
EncryptedPassword: "password",
Tenant: "tenant-1",
IsSuper: true,
Sha256Password: "xxxx",
}
)
func TestMarshalCredentialModel(t *testing.T) {
ret := MarshalCredentialModel(credentialModel)
assert.Equal(t, credentialPb, ret)
assert.Nil(t, MarshalCredentialModel(nil))
}