mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 13:28:49 +08:00
9672eae62c
Signed-off-by: yun.zhang <yun.zhang@zilliz.com>
35 lines
708 B
Go
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))
|
|
}
|