Skip to content

Commit e3a9212

Browse files
author
Laurie T. Malau
committed
m
1 parent 8d3f0e8 commit e3a9212

File tree

3 files changed

+10
-51
lines changed

3 files changed

+10
-51
lines changed

components/common-go/db/dbtest/conn.go

Lines changed: 0 additions & 43 deletions
This file was deleted.

components/common-go/db/dbtest/personal_access_token.go renamed to components/gitpod-db/go/personal_access_token.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the GNU Affero General Public License (AGPL).
33
// See License-AGPL.txt in the project root for license information.
44

5-
package dbtest
5+
package db
66

77
import (
88
"context"

components/common-go/db/dbtest/personal_access_token_test.go renamed to components/gitpod-db/go/personal_access_token_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
// Licensed under the GNU Affero General Public License (AGPL).
33
// See License-AGPL.txt in the project root for license information.
44

5-
package dbtest
5+
package db_test
66

77
import (
88
"context"
99
"testing"
1010
"time"
1111

12+
db "github.com/gitpod-io/gitpod/components/gitpod-db/go"
13+
"github.com/gitpod-io/gitpod/components/gitpod-db/go/dbtest"
1214
"github.com/google/uuid"
1315
"github.com/stretchr/testify/require"
1416
)
1517

1618
func TestPersonalAccessToken_Get(t *testing.T) {
17-
conn := ConnectForTests(t)
19+
conn := dbtest.ConnectForTests(t)
1820

19-
token := PersonalAccessToken{
21+
token := db.PersonalAccessToken{
2022
ID: uuid.New(),
2123
UserID: uuid.New(),
2224
Hash: "some-secure-hash",
@@ -31,15 +33,15 @@ func TestPersonalAccessToken_Get(t *testing.T) {
3133
tx := conn.Create(token)
3234
require.NoError(t, tx.Error)
3335

34-
result, err := GetToken(context.Background(), conn, token.ID)
36+
result, err := db.GetToken(context.Background(), conn, token.ID)
3537
require.NoError(t, err)
3638
require.Equal(t, token.ID, result.ID)
3739
}
3840

3941
func TestPersonalAccessToken_Create(t *testing.T) {
40-
conn := ConnectForTests(t)
42+
conn := dbtest.ConnectForTests(t)
4143

42-
request := PersonalAccessToken{
44+
request := db.PersonalAccessToken{
4345
ID: uuid.New(),
4446
UserID: uuid.New(),
4547
Hash: "another-secure-hash",
@@ -51,7 +53,7 @@ func TestPersonalAccessToken_Create(t *testing.T) {
5153
LastModified: time.Now(),
5254
}
5355

54-
result, err := CreateToken(context.Background(), conn, request)
56+
result, err := db.CreateToken(context.Background(), conn, request)
5557
require.NoError(t, err)
5658

5759
require.Equal(t, request.ID, result.ID)

0 commit comments

Comments
 (0)