Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for GetOrphanTasks #6036

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading