Add the Read/List service functions (#2123)
This commit is contained in:
9 files changed
+747
-108
No files matched your search
@@ -14,7 +14,12 @@ import (
|
||||
func TestTestWorker(t *testing.T) {
|
||||
conn, _ := db.TestSetup(t, "postgres")
|
||||
wrapper := db.TestWrapper(t)
|
||||
tWorker := TestWorker(t, conn, wrapper)
|
||||
const (
|
||||
name = "test name"
|
||||
description = "test description"
|
||||
address = "test address"
|
||||
)
|
||||
tWorker := TestWorker(t, conn, wrapper, WithName(name), WithDescription(description), WithAddress(address))
|
||||
assert.NotNil(t, tWorker)
|
||||
assert.True(t, strings.HasPrefix(tWorker.GetPublicId(), WorkerPrefix))
|
||||
|
||||
@@ -23,4 +28,8 @@ func TestTestWorker(t *testing.T) {
|
||||
rw := db.New(conn)
|
||||
require.NoError(t, rw.LookupById(context.Background(), lkpWorker))
|
||||
assert.NotNil(t, lkpWorker)
|
||||
assert.NotNil(t, lkpWorker.GetLastStatusTime())
|
||||
assert.Equal(t, name, lkpWorker.GetName())
|
||||
assert.Equal(t, description, lkpWorker.GetDescription())
|
||||
assert.Equal(t, address, lkpWorker.GetAddress())
|
||||
}
|
||||
Reference in new issue
Block a user