This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git
The following commit(s) were added to refs/heads/master by this push:
new 0914863 List operation support wildcard match method (#182)
0914863 is described below
commit 0914863082dd9098edb7266d890cbd67449fb564
Author: little-cui <[email protected]>
AuthorDate: Thu Apr 22 22:51:26 2021 +0800
List operation support wildcard match method (#182)
---
server/service/mongo/kv/kv_service_test.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/server/service/mongo/kv/kv_service_test.go
b/server/service/mongo/kv/kv_service_test.go
index af7d12f..07e854d 100644
--- a/server/service/mongo/kv/kv_service_test.go
+++ b/server/service/mongo/kv/kv_service_test.go
@@ -114,7 +114,6 @@ func TestService_CreateOrUpdate(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, afterKV.Value, savedKV.Value)
})
-
}
func TestService_Create(t *testing.T) {
@@ -150,6 +149,14 @@ func TestService_Create(t *testing.T) {
})
assert.EqualError(t, err, session.ErrKVAlreadyExists.Error())
})
+ t.Run("list the kv", func(t *testing.T) {
+ res, err := kvsvc.List(context.TODO(), "default", "kv-test",
service.WithKey("wildcard(time*1)"))
+ assert.NoError(t, err)
+ assert.Equal(t, 0, len(res.Data))
+ res, err = kvsvc.List(context.TODO(), "default", "kv-test",
service.WithKey("wildcard(time*t)"))
+ assert.NoError(t, err)
+ assert.NotEqual(t, 0, len(res.Data))
+ })
}
func TestService_Update(t *testing.T) {