Skip to content

Commit

Permalink
feat(server): support CJK in fields keys (#1261)
Browse files Browse the repository at this point in the history
* imp

* rollback FE changes
  • Loading branch information
yk-eukarya authored Oct 15, 2024
1 parent 08be04c commit 62d74d5
Show file tree
Hide file tree
Showing 53 changed files with 403 additions and 447 deletions.
35 changes: 17 additions & 18 deletions server/e2e/integration_item_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/integration"
"github.com/reearth/reearth-cms/server/pkg/item"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/model"
"github.com/reearth/reearth-cms/server/pkg/operator"
"github.com/reearth/reearth-cms/server/pkg/project"
Expand Down Expand Up @@ -69,26 +68,26 @@ var (
thId4 = id.NewThreadID()
thId5 = id.NewThreadID()
icId = id.NewCommentID()
ikey1 = key.Random()
ikey2 = key.Random()
ikey3 = key.Random()
ikey4 = key.Random()
ikey0 = id.RandomKey()
ikey1 = id.RandomKey()
ikey2 = id.RandomKey()
ikey3 = id.RandomKey()
ikey4 = id.RandomKey()
pid = id.NewProjectID()
sid0 = id.NewSchemaID()
sid1 = id.NewSchemaID()
sid2 = id.NewSchemaID()
sid3 = id.NewSchemaID()
palias = "PROJECT_ALIAS"
sfKey1 = key.Random()
sfKey1 = id.RandomKey()
sfKey2 = id.NewKey("asset")
sfKey3 = key.Random()
sfKey4 = key.Random()
sfKey3 = id.RandomKey()
sfKey4 = id.RandomKey()
sfKey5 = id.NewKey("asset-key")
sfKey6 = id.NewKey("group-key")
sfKey7 = id.NewKey("geometry-key")
sfKey8 = id.NewKey("geometry-editor-key")
gKey1 = key.Random()
gKey1 = id.RandomKey()
gId1 = id.NewItemGroupID()
gId2 = id.NewItemGroupID()
gId3 = id.NewItemGroupID()
Expand Down Expand Up @@ -380,28 +379,28 @@ func baseSeeder(ctx context.Context, r *repo.Container) error {
// endregion

// Default value
msf1 := schema.NewField(schema.NewBool().TypeProperty()).NewID().Key(key.Random()).DefaultValue(schema.NewBool().TypeProperty().Type().Value(true).AsMultiple()).MustBuild()
msf1 := schema.NewField(schema.NewBool().TypeProperty()).NewID().Key(id.RandomKey()).DefaultValue(schema.NewBool().TypeProperty().Type().Value(true).AsMultiple()).MustBuild()
sm := schema.New().NewID().Workspace(w.ID()).Project(pid).Fields([]*schema.Field{msf1}).MustBuild()
if err := r.Schema.Save(ctx, sm); err != nil {
return err
}
gsf := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.Random()).DefaultValue(schema.NewText(nil).TypeProperty().Type().Value("default group").AsMultiple()).MustBuild()
gsf := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.RandomKey()).DefaultValue(schema.NewText(nil).TypeProperty().Type().Value("default group").AsMultiple()).MustBuild()
gs := schema.New().NewID().Workspace(w.ID()).Project(pid).Fields([]*schema.Field{gsf}).MustBuild()
if err := r.Schema.Save(ctx, gs); err != nil {
return err
}
gp := group.New().NewID().Name("group2").Project(pid).Key(key.Random()).Schema(gs.ID()).MustBuild()
gp := group.New().NewID().Name("group2").Project(pid).Key(id.RandomKey()).Schema(gs.ID()).MustBuild()
if err := r.Group.Save(ctx, gp); err != nil {
return err
}
dvsf1 := schema.NewField(schema.NewText(nil).TypeProperty()).ID(dvsfId).Key(key.Random()).MustBuild()
dvsf2 := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.Random()).DefaultValue(schema.NewText(nil).TypeProperty().Type().Value("default").AsMultiple()).MustBuild()
dvsf3 := schema.NewField(schema.NewGroup(gp.ID()).TypeProperty()).NewID().Key(key.Random()).MustBuild()
dvsf1 := schema.NewField(schema.NewText(nil).TypeProperty()).ID(dvsfId).Key(id.RandomKey()).MustBuild()
dvsf2 := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.RandomKey()).DefaultValue(schema.NewText(nil).TypeProperty().Type().Value("default").AsMultiple()).MustBuild()
dvsf3 := schema.NewField(schema.NewGroup(gp.ID()).TypeProperty()).NewID().Key(id.RandomKey()).MustBuild()

gst2 := schema.GeometryObjectSupportedTypeList{schema.GeometryObjectSupportedTypePoint, schema.GeometryObjectSupportedTypeLineString}
gest2 := schema.GeometryEditorSupportedTypeList{schema.GeometryEditorSupportedTypePoint, schema.GeometryEditorSupportedTypeLineString}
dvsf4 := schema.NewField(schema.NewGeometryObject(gst2).TypeProperty()).NewID().Key(key.Random()).MustBuild()
dvsf5 := schema.NewField(schema.NewGeometryEditor(gest2).TypeProperty()).NewID().Key(key.Random()).MustBuild()
dvsf4 := schema.NewField(schema.NewGeometryObject(gst2).TypeProperty()).NewID().Key(id.RandomKey()).MustBuild()
dvsf5 := schema.NewField(schema.NewGeometryEditor(gest2).TypeProperty()).NewID().Key(id.RandomKey()).MustBuild()

dvs1 := schema.New().NewID().Workspace(w.ID()).Project(pid).Fields([]*schema.Field{dvsf1, dvsf2, dvsf3, dvsf4, dvsf5}).MustBuild()
if err := r.Schema.Save(ctx, dvs1); err != nil {
Expand All @@ -412,7 +411,7 @@ func baseSeeder(ctx context.Context, r *repo.Container) error {
Name("dvm").
Description("dvm desc").
Public(true).
Key(key.Random()).
Key(id.RandomKey()).
Project(pid).
Schema(dvs1.ID()).
Metadata(sm.ID().Ref()).
Expand Down
21 changes: 10 additions & 11 deletions server/e2e/publicapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/reearth/reearth-cms/server/pkg/asset"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/item"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/model"
"github.com/reearth/reearth-cms/server/pkg/project"
"github.com/reearth/reearth-cms/server/pkg/schema"
Expand Down Expand Up @@ -361,22 +360,22 @@ func publicAPISeeder(ctx context.Context, r *repo.Container) error {
gst := schema.GeometryObjectSupportedTypeList{schema.GeometryObjectSupportedTypePoint, schema.GeometryObjectSupportedTypeLineString}
gest := schema.GeometryEditorSupportedTypeList{schema.GeometryEditorSupportedTypePoint, schema.GeometryEditorSupportedTypeLineString}
s := schema.New().NewID().Project(p1.ID()).Workspace(p1.Workspace()).Fields(schema.FieldList{
schema.NewField(schema.NewText(nil).TypeProperty()).ID(fid).Name(publicAPIField1Key).Key(key.New(publicAPIField1Key)).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Name(publicAPIField2Key).Key(key.New(publicAPIField2Key)).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Name(publicAPIField3Key).Key(key.New(publicAPIField3Key)).Multiple(true).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Name(publicAPIField4Key).Key(key.New(publicAPIField4Key)).Multiple(true).MustBuild(),
schema.NewField(schema.NewGeometryObject(gst).TypeProperty()).NewID().Name(publicAPIField5Key).Key(key.New(publicAPIField5Key)).MustBuild(),
schema.NewField(schema.NewGeometryEditor(gest).TypeProperty()).NewID().Name(publicAPIField6Key).Key(key.New(publicAPIField6Key)).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).ID(fid).Name(publicAPIField1Key).Key(id.NewKey(publicAPIField1Key)).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Name(publicAPIField2Key).Key(id.NewKey(publicAPIField2Key)).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Name(publicAPIField3Key).Key(id.NewKey(publicAPIField3Key)).Multiple(true).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Name(publicAPIField4Key).Key(id.NewKey(publicAPIField4Key)).Multiple(true).MustBuild(),
schema.NewField(schema.NewGeometryObject(gst).TypeProperty()).NewID().Name(publicAPIField5Key).Key(id.NewKey(publicAPIField5Key)).MustBuild(),
schema.NewField(schema.NewGeometryEditor(gest).TypeProperty()).NewID().Name(publicAPIField6Key).Key(id.NewKey(publicAPIField6Key)).MustBuild(),
}).TitleField(fid.Ref()).MustBuild()

s2 := schema.New().NewID().Project(p1.ID()).Workspace(p1.Workspace()).Fields(schema.FieldList{
schema.NewField(schema.NewText(nil).TypeProperty()).ID(fid).Name(publicAPIField1Key).Key(key.New(publicAPIField1Key)).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).ID(fid).Name(publicAPIField1Key).Key(id.NewKey(publicAPIField1Key)).MustBuild(),
}).MustBuild()

m := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s.ID()).Public(true).Key(key.New(publicAPIModelKey)).MustBuild()
m := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s.ID()).Public(true).Key(id.NewKey(publicAPIModelKey)).MustBuild()
// m2 is not a public model
m2 := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s.ID()).Name(publicAPIModelKey2).Key(key.New(publicAPIModelKey2)).Public(false).MustBuild()
m3 := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s2.ID()).Name(publicAPIModelKey3).Key(key.New(publicAPIModelKey3)).Public(true).MustBuild()
m2 := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s.ID()).Name(publicAPIModelKey2).Key(id.NewKey(publicAPIModelKey2)).Public(false).MustBuild()
m3 := model.New().ID(publicAPIModelID).Project(p1.ID()).Schema(s2.ID()).Name(publicAPIModelKey3).Key(id.NewKey(publicAPIModelKey3)).Public(true).MustBuild()

i1 := item.New().ID(publicAPIItem1ID).Model(m.ID()).Schema(s.ID()).Project(p1.ID()).Thread(id.NewThreadID()).User(uid).Fields([]*item.Field{
item.NewField(s.Fields()[0].ID(), value.TypeText.Value("aaa").AsMultiple(), nil),
Expand Down
4 changes: 2 additions & 2 deletions server/internal/adapter/gql/gqlmodel/convert_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/reearth/reearth-cms/server/pkg/group"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/project"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/stretchr/testify/assert"
Expand All @@ -14,7 +14,7 @@ func TestToGroup(t *testing.T) {
mId := group.NewID()
pId := project.NewID()
sId := schema.NewID()
k := key.Random()
k := id.RandomKey()
tests := []struct {
name string
group *group.Group
Expand Down
5 changes: 2 additions & 3 deletions server/internal/adapter/gql/gqlmodel/convert_item_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/reearth/reearth-cms/server/internal/usecase/interfaces"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/item"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearth-cms/server/pkg/value"
"github.com/reearth/reearth-cms/server/pkg/version"
Expand All @@ -25,7 +24,7 @@ func TestToItem(t *testing.T) {
nid := id.NewIntegrationID()
tid := id.NewThreadID()
pid := id.NewProjectID()
sf1 := schema.NewField(schema.NewText(lo.ToPtr(10)).TypeProperty()).NewID().Key(key.Random()).MustBuild()
sf1 := schema.NewField(schema.NewText(lo.ToPtr(10)).TypeProperty()).NewID().Key(id.RandomKey()).MustBuild()
sf := []*schema.Field{sf1}
s := schema.New().ID(sid).Fields(sf).Workspace(accountdomain.NewWorkspaceID()).TitleField(sf1.ID().Ref()).Project(pid).MustBuild()
i := item.New().
Expand Down Expand Up @@ -128,7 +127,7 @@ func TestToVersionedItem(t *testing.T) {
iid := id.NewItemID()
sid := id.NewSchemaID()
ref := "a"
sf1 := schema.NewField(schema.NewBool().TypeProperty()).NewID().Key(key.Random()).MustBuild()
sf1 := schema.NewField(schema.NewBool().TypeProperty()).NewID().Key(id.RandomKey()).MustBuild()
sf := []*schema.Field{sf1}
s := schema.New().ID(sid).Fields(sf).Workspace(accountdomain.NewWorkspaceID()).Project(pId).MustBuild()
fs := []*item.Field{item.NewField(sf1.ID(), value.TypeBool.Value(true).AsMultiple(), nil)}
Expand Down
7 changes: 4 additions & 3 deletions server/internal/adapter/gql/gqlmodel/convert_model_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package gqlmodel

import (
"github.com/samber/lo"
"testing"

"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/samber/lo"

"github.com/reearth/reearth-cms/server/pkg/model"
"github.com/reearth/reearth-cms/server/pkg/project"
"github.com/reearth/reearth-cms/server/pkg/schema"
Expand All @@ -15,7 +16,7 @@ func TestToModel(t *testing.T) {
mId := model.NewID()
pId := project.NewID()
sId := schema.NewID()
k := key.Random()
k := id.RandomKey()
tests := []struct {
name string
model *model.Model
Expand Down
5 changes: 2 additions & 3 deletions server/internal/adapter/gql/gqlmodel/convert_schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearth-cms/server/pkg/value"
"github.com/reearth/reearthx/account/accountdomain"
Expand All @@ -17,7 +16,7 @@ func TestToSchema(t *testing.T) {
pId := id.NewProjectID()
sId := schema.NewID()
fId := id.NewFieldID()
k := key.Random()
k := id.RandomKey()
tests := []struct {
name string
schema *schema.Schema
Expand Down Expand Up @@ -91,7 +90,7 @@ func TestToSchemaField(t *testing.T) {
UpdatedAt(fid.Timestamp()).
Name("N1").
Description("D1").
Key(key.New("K123456")).
Key(id.NewKey("K123456")).
Unique(true).
Multiple(true).
Required(true).
Expand Down
5 changes: 2 additions & 3 deletions server/internal/adapter/integration/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/reearth/reearth-cms/server/pkg/integrationapi"
"github.com/reearth/reearth-cms/server/pkg/item"
"github.com/reearth/reearth-cms/server/pkg/item/view"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearth-cms/server/pkg/value"
"github.com/reearth/reearthx/usecasex"
Expand Down Expand Up @@ -53,9 +52,9 @@ func fromItemFieldParam(f integrationapi.Field, sf *schema.Field) interfaces.Ite
v = *f.Value
}

var k *key.Key
var k *id.Key
if f.Key != nil {
k = key.New(*f.Key).Ref()
k = id.NewKey(*f.Key).Ref()
}

return interfaces.ItemFieldParam{
Expand Down
5 changes: 2 additions & 3 deletions server/internal/adapter/integration/item_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/reearth/reearth-cms/server/internal/usecase/interfaces"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/integrationapi"
key2 "github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearth-cms/server/pkg/value"
"github.com/reearth/reearthx/i18n"
Expand Down Expand Up @@ -179,7 +178,7 @@ func itemsFromJson(r io.Reader, isGeoJson bool, geoField *string, sp schema.Pack
return nil, nil, rerror.ErrInvalidParams
}

geoFieldKey := key2.New(*geoField)
geoFieldKey := id.NewKey(*geoField)
if !geoFieldKey.IsValid() {
return nil, nil, rerror.ErrInvalidParams
}
Expand Down Expand Up @@ -211,7 +210,7 @@ func itemsFromJson(r io.Reader, isGeoJson bool, geoField *string, sp schema.Pack
if v == nil {
continue
}
key := key2.New(k)
key := id.NewKey(k)
if !key.IsValid() {
return nil, nil, rerror.ErrInvalidParams
}
Expand Down
5 changes: 2 additions & 3 deletions server/internal/adapter/integration/item_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/reearth/reearth-cms/server/internal/usecase/interfaces"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/integrationapi"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearthx/account/accountdomain"
"github.com/samber/lo"
Expand All @@ -22,8 +21,8 @@ func Test_convertMetaFields(t *testing.T) {
tag2 := schema.NewTag("日本語", schema.TagColorOrange)
tf, _ := schema.NewFieldTag(schema.TagList{tag1, tag2})

sf1 := schema.NewField(tf.TypeProperty()).NewID().Key(key.New("sf-1")).MustBuild()
sf2 := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.New("sf-1")).MustBuild()
sf1 := schema.NewField(tf.TypeProperty()).NewID().Key(id.NewKey("sf-1")).MustBuild()
sf2 := schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.NewKey("sf-1")).MustBuild()
var vi any = "日本語"
var vi2 any = "xyz"
s := schema.New().NewID().Fields(schema.FieldList{sf1, sf2}).Project(id.NewProjectID()).Workspace(accountdomain.NewWorkspaceID()).MustBuild()
Expand Down
18 changes: 9 additions & 9 deletions server/internal/adapter/publicapi/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package publicapi

import (
"encoding/json"
"github.com/reearth/reearth-cms/server/pkg/group"
"testing"

"github.com/reearth/reearth-cms/server/pkg/group"

"github.com/reearth/reearth-cms/server/pkg/asset"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/item"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearth-cms/server/pkg/schema"
"github.com/reearth/reearth-cms/server/pkg/value"
"github.com/reearth/reearthx/account/accountdomain"
Expand All @@ -32,15 +32,15 @@ func TestNewItem(t *testing.T) {
Project(id.NewProjectID()).
Workspace(accountdomain.NewWorkspaceID()).
Fields([]*schema.Field{
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.New("test1")).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.NewKey("test1")).MustBuild(),
}).
MustBuild()

g := group.New().
NewID().
Name("test group").
Project(id.NewProjectID()).
Key(key.New("group1")).
Key(id.NewKey("group1")).
Schema(s2.ID()).
MustBuild()

Expand All @@ -49,9 +49,9 @@ func TestNewItem(t *testing.T) {
Project(id.NewProjectID()).
Workspace(accountdomain.NewWorkspaceID()).
Fields([]*schema.Field{
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.New("aaaaa")).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Key(key.New("bbbbb")).MustBuild(),
schema.NewField(schema.NewGroup(g.ID()).TypeProperty()).NewID().Key(key.New("ggggg")).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.NewKey("aaaaa")).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Key(id.NewKey("bbbbb")).MustBuild(),
schema.NewField(schema.NewGroup(g.ID()).TypeProperty()).NewID().Key(id.NewKey("ggggg")).MustBuild(),
}).
MustBuild()
ig := id.NewItemGroupID()
Expand Down Expand Up @@ -112,8 +112,8 @@ func TestNewItem_Multiple(t *testing.T) {
Project(id.NewProjectID()).
Workspace(accountdomain.NewWorkspaceID()).
Fields([]*schema.Field{
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(key.New("aaaaa")).Multiple(true).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Key(key.New("bbbbb")).Multiple(true).MustBuild(),
schema.NewField(schema.NewText(nil).TypeProperty()).NewID().Key(id.NewKey("aaaaa")).Multiple(true).MustBuild(),
schema.NewField(schema.NewAsset().TypeProperty()).NewID().Key(id.NewKey("bbbbb")).Multiple(true).MustBuild(),
}).
MustBuild()
it := item.New().
Expand Down
7 changes: 3 additions & 4 deletions server/internal/infrastructure/memory/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/reearth/reearth-cms/server/internal/usecase/repo"
"github.com/reearth/reearth-cms/server/pkg/group"
"github.com/reearth/reearth-cms/server/pkg/id"
"github.com/reearth/reearth-cms/server/pkg/key"
"github.com/reearth/reearthx/rerror"
"github.com/reearth/reearthx/util"
"github.com/stretchr/testify/assert"
Expand All @@ -34,7 +33,7 @@ func TestGroupRepo_FindByID(t *testing.T) {
pid1 := id.NewProjectID()
id1 := id.NewGroupID()
sid1 := id.NewSchemaID()
k := key.New("T123456")
k := id.NewKey("T123456")
m1 := group.New().ID(id1).Project(pid1).Schema(sid1).Key(k).MustBuild()

tests := []struct {
Expand Down Expand Up @@ -141,7 +140,7 @@ func TestGroupRepo_FindByIDs(t *testing.T) {
id2 := id.NewGroupID()
sid1 := id.NewSchemaID()
sid2 := id.NewSchemaID()
k := key.New("T123456")
k := id.NewKey("T123456")
m1 := group.New().ID(id1).Project(pid1).Schema(sid1).Key(k).MustBuild()
m2 := group.New().ID(id2).Project(pid1).Schema(sid2).Key(k).MustBuild()

Expand Down Expand Up @@ -258,7 +257,7 @@ func TestGroupRepo_FindByProject(t *testing.T) {
id2 := id.NewGroupID()
sid1 := id.NewSchemaID()
sid2 := id.NewSchemaID()
k := key.New("T123456")
k := id.NewKey("T123456")
m1 := group.New().ID(id1).Project(pid1).Schema(sid1).Key(k).MustBuild()
m2 := group.New().ID(id2).Project(pid1).Schema(sid2).Key(k).MustBuild()

Expand Down
Loading

0 comments on commit 62d74d5

Please sign in to comment.