You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sql_task_store_test.go
    path of file: ./repos/cadence/common/persistence/sql
    
    the code of the file until where you have to start completion: // Copyright (c) 2020 Uber Technologies, Inc.
// Portions of the Software are attributed to Copyright (c) 2020 Temporal Technologies Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Softwar
    
func TestListTaskList(t *testing.T) {
	pageSize := 1
	testCases := []struct {
		name      string
		pageToken *taskListPageToken
		mockSetup func(*sqlplugin.MockDB, *serialization.MockParser)
		want      *persistence.ListTaskListResponse
		wantToken *taskListPageToken
		wantErr   bool
	}{
		{
			name: "Success case",
			pageToken: &taskListPageToken{
				ShardID:  10,
				DomainID: serialization.MustParseUUID("c9488dc7-20b2-44c3-b2e4-bfea5af62ac0"),
				Name:     "tl",
				TaskType: 0,
			},
			mockSetup: func(mockDB *sqlplugin.MockDB, mockParser *serialization.MockParser) {
				mockDB.EXPECT().SelectFromTaskLists(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, filter *sqlplugin.TaskListsFilter) ([]sqlplugin.TaskListsRow, error) {
					assert.Equal(t, 10, filter.ShardID)
					assert.Equal(t, serialization.MustParseUUID("c9488dc7-20b2-44c3-b2e4-bfea5af62ac0"), *filter.DomainIDGreaterThan)
					assert.Equal(t, "tl", *filter.NameGreaterThan)
					assert.Equal(t, int64(0), *filter.TaskTypeGreaterThan)
					assert.Equal(t, 1, *filter.PageSize)
					return []sqlplugin.TaskListsRow{}, nil
				})
				mockDB.EXPECT().SelectFromTaskLists(gomock.Any(), gomock.Any()).DoAndReturn(func(_ context.Context, filter *sqlplugin.TaskListsFilter) ([]sqlplugin.TaskListsRow, error) {
					assert.Equal(t, 11, filter.ShardID)
					assert.Equal(t, serialization.UUID{}, *filter.DomainIDGreaterThan)
					assert.Equal(t, "", *filter.NameGreaterThan)
					assert.Equal(t, int64(math.MinInt16), *filter.TaskTypeGreaterThan)
					assert.Equal(t, 1, *filter.PageSize)
					return []sqlplugin.TaskListsRow{
						{
							ShardID:      11,
							DomainID:     serialization.MustParseUUID("c9488dc7-20b2-44c3-b2e4-bfea5af62ac0"),
							Name:         "tl",
							TaskType:     1,
							RangeID:      123,
							Data:         []byte(`tl`),
							DataEncoding: "tl",
						},
					}, nil
				})
				mockParser.EXPECT().TaskListInfoFromBlob([]byte(`tl`), "tl").Return(&serialization.TaskListInfo{
					Kind:            1,
					AckLevel:        2,
					ExpiryTimestamp: time.Unix(1, 4),
					LastUpdated:     time.Unix(10, 0),
				}, nil)
			},
			want: &persistence.ListTaskListResponse{
				Items: []persistence.TaskListInfo{
					{
						DomainID:    "c9488dc7-20b2-44c3-b2e4-bfea5af62ac0",
						Name:        "tl",
						TaskType:    1,
						RangeID:     123,
						Kind:        1,
						AckLevel:    2,
						Expiry:      time.Unix(1, 4),
						LastUpdated: time.Unix(10, 0),
					},
				},
				NextPageToken: func() []byte {
					token, err := gobSerialize(&taskListPageToken{
						ShardID:  11,
						DomainID: serialization.MustParseUUID("c9488dc7-20b2-44c3-b2e4-bfea5af62ac0"),
						Name:     "tl",
						TaskType: 1,
					})
					require.NoError(t, err, "failed to serialize page token")
					return token
				}(),
			},
			wantErr: false,
		},
		{
			name: "Error case",
			pageToken: &taskListPageToken{
				ShardID:  10,
				DomainID: serialization.MustParseUUID("c9488dc7-20b2-44c3-b2e4-bfea5af62ac0"),
				Name:     "tl",
				TaskType: 0,
			},
			mockSetup: func(mockDB *sqlplugin.MockDB, mockParser *serialization.MockParser) {
				err := errors.New("some error")
				mockDB.EXPECT().SelectFromTaskLists(gomock.Any(), gomock.Any()).Return(nil, err)
				mockDB.EXPECT().IsNotFoundError(err).Return(true)
			},
			wantErr: true,
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			ctrl := gomock.NewController(t)
			defer ctrl.Finish()

			mockDB := sqlplugin.NewMockDB(ctrl)
			mockParser := serialization.NewMockParser(ctrl)
			store := &sqlTaskStore{
				sqlStore: sqlStore{db: mockDB, parser: mockParser},
				nShards:  1000,
			}

			tc.mockSetup(mockDB, mockParser)

			pageToken, err := gobSerialize(tc.pageToken)
			require.NoError(t, err, "invalid pageToken")
			req := &persistence.ListTaskListRequest{
				PageSize:  pageSize,
				PageToken: pageToken,
			}
			got, err := store.ListTaskList(context.Background(), req)
			if tc.wantErr {
				assert.Error(t, err, "Expected an error for test case")
			} else {
				assert.NoError(t, err, "Did not expect an error for test case")
				assert.Equal(t, tc.want, got, "Unexpected result for test case")
			}
		})
	}
}