Skip to content

Commit

Permalink
✅ Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
tosone committed Aug 12, 2023
1 parent 1eb4f0f commit e31c099
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/dal/migrations/postgresql/0001_initialize.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS "code_repository_clone_credentials" (
"id" bigserial PRIMARY KEY,
"user_3rdparty_id" bigint NOT NULL,
"type" code_repository_clone_credentials_type NOT NULL,
"ssh_key" BLOB,
"ssh_key" bytea,
"username" varchar(256),
"password" varchar(256),
"token" varchar(256),
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/tokens/tokens_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestToken(t *testing.T) {

var tokenTimes int
tokenMock := tokenmock.NewMockTokenService(ctrl)
tokenMock.EXPECT().New(gomock.Any(), gomock.Any()).DoAndReturn(func(_ *models.User, _ time.Duration) (string, error) {
tokenMock.EXPECT().New(gomock.Any(), gomock.Any()).DoAndReturn(func(_ int64, _ time.Duration) (string, error) {
if tokenTimes == 0 {
tokenTimes++
return "test", nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/users/users_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestLoginMockToken(t *testing.T) {

var times int
tokenMock := tokenmock.NewMockTokenService(ctrl)
tokenMock.EXPECT().New(gomock.Any(), gomock.Any()).DoAndReturn(func(_ *models.User, _ time.Duration) (string, error) {
tokenMock.EXPECT().New(gomock.Any(), gomock.Any()).DoAndReturn(func(_ int64, _ time.Duration) (string, error) {
times++
if times == 2 {
return "test", nil
Expand Down

0 comments on commit e31c099

Please sign in to comment.