diff --git a/infrastructure/tests/sqlite_db_connect.go b/infrastructure/tests/sqlite_db_connect.go index 85f10ad..a145d56 100644 --- a/infrastructure/tests/sqlite_db_connect.go +++ b/infrastructure/tests/sqlite_db_connect.go @@ -7,6 +7,7 @@ import ( "gorm.io/driver/sqlite" "gorm.io/gorm" + "gorm.io/gorm/logger" ) type SqliteDBConnect struct { @@ -29,6 +30,7 @@ func NewSqliteDBConnect() (*SqliteDBConnect, error) { dbConn, err := gorm.Open(dialector, &gorm.Config{ SkipDefaultTransaction: true, + Logger: logger.Default.LogMode(logger.Info), }) if err != nil { return nil, err diff --git a/samples/persistence/account/account_repository_test.go b/samples/persistence/account/account_repository_test.go index 7002c24..c3be541 100644 --- a/samples/persistence/account/account_repository_test.go +++ b/samples/persistence/account/account_repository_test.go @@ -34,16 +34,17 @@ func (ts *AccountRepositoryTestSuite) SetupSuite() { } func (ts *AccountRepositoryTestSuite) TestCreateAccount() { - entityId := customgorm.CustomTypeUUIDv1FromString(uuid.New().String()) + entityId, err := uuid.NewUUID() + ts.NoError(err) account := AccountModel{ BaseModel: persistence.BaseModel{ - ID: entityId, + ID: customgorm.CustomTypeUUIDv1FromString(entityId.String()), }, AccountName: "abc", } - err := ts.accountRepo.Create(account) + err = ts.accountRepo.Create(account) ts.NoError(err) all, err := ts.accountRepo.GetAll()