Skip to content

Commit

Permalink
Added test for GetOrphanTasks (#6036)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobht authored May 23, 2024
1 parent 144a627 commit fb4bfce
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions common/persistence/nosql/nosql_task_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package nosql

import (
ctx "context"
"context"
"testing"

"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -75,6 +75,17 @@ func setupNoSQLStoreMocks(t *testing.T) (*nosqlTaskStore, *nosqlplugin.MockDB) {
return store, dbMock
}

func TestGetOrphanTasks(t *testing.T) {
store, _ := setupNoSQLStoreMocks(t)

// We just expect the function to return an error so we don't need to check the result
_, err := store.GetOrphanTasks(context.Background(), nil)

var expectedErr *types.InternalServiceError
assert.ErrorAs(t, err, &expectedErr)
assert.ErrorContains(t, err, "Unimplemented call to GetOrphanTasks for NoSQL")
}

func TestGetTaskListSize(t *testing.T) {
store, db := setupNoSQLStoreMocks(t)

Expand All @@ -90,7 +101,7 @@ func TestGetTaskListSize(t *testing.T) {
},
).Return(int64(123), nil)

size, err := store.GetTaskListSize(ctx.Background(), &persistence.GetTaskListSizeRequest{
size, err := store.GetTaskListSize(context.Background(), &persistence.GetTaskListSizeRequest{
DomainID: TestDomainID,
DomainName: TestDomainName,
TaskListName: TestTaskListName,
Expand Down

0 comments on commit fb4bfce

Please sign in to comment.