Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
refactor(BUX-411): unnecessary With* func options - partially removed
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-4chain committed Dec 15, 2023
1 parent 60a3fd5 commit 940725b
Show file tree
Hide file tree
Showing 18 changed files with 107 additions and 115 deletions.
2 changes: 1 addition & 1 deletion action_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func BenchmarkAction_Transaction_newTransaction(b *testing.B) {

func initBenchmarkData(b *testing.B) (context.Context, ClientInterface, *Xpub, *TransactionConfig, error) {
ctx, client, _ := CreateBenchmarkSQLiteClient(b, false, true,
WithCustomTaskManager(&taskManagerMockBase{}),
withTaskManagerMockup(),
WithFreeCache(),
WithIUCDisabled(),
)
Expand Down
7 changes: 7 additions & 0 deletions bux_suite_mocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ func (tm *taskManagerMockBase) IsNewRelicEnabled() bool {
func (tm *taskManagerMockBase) CronJobsInit(cronJobsMap taskmanager.CronJobs) error {
return nil
}

// Sets custom task manager only for testing
func withTaskManagerMockup() ClientOps {
return func(c *clientOptions) {
c.taskManager.TaskManagerInterface = &taskManagerMockBase{}
}
}
11 changes: 4 additions & 7 deletions bux_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func (ts *EmbeddedDBTestSuite) serveMySQL() {

// SetupSuite runs at the start of the suite
func (ts *EmbeddedDBTestSuite) SetupSuite() {

var err error

// Create the MySQL server
Expand Down Expand Up @@ -120,7 +119,6 @@ func (ts *EmbeddedDBTestSuite) SetupSuite() {

// TearDownSuite runs after the suite finishes
func (ts *EmbeddedDBTestSuite) TearDownSuite() {

// Stop the Mongo server
if ts.MongoServer != nil {
ts.MongoServer.Stop()
Expand Down Expand Up @@ -157,8 +155,8 @@ func (ts *EmbeddedDBTestSuite) TearDownTest() {
//
// NOTE: you need to close the client: ts.Close()
func (ts *EmbeddedDBTestSuite) createTestClient(ctx context.Context, database datastore.Engine,
tablePrefix string, mockDB, mockRedis bool, opts ...ClientOps) (*TestingClient, error) {

tablePrefix string, mockDB, mockRedis bool, opts ...ClientOps,
) (*TestingClient, error) {
var err error

// Start the suite
Expand Down Expand Up @@ -201,7 +199,6 @@ func (ts *EmbeddedDBTestSuite) createTestClient(ctx context.Context, database da
}

} else {

// Load the in-memory version of the database
if database == datastore.SQLite {
opts = append(opts, WithSQLite(&datastore.SQLiteConfig{
Expand Down Expand Up @@ -331,7 +328,7 @@ func (ts *EmbeddedDBTestSuite) genericDBClient(t *testing.T, database datastore.
if taskManagerEnabled {
opts = append(opts, WithTaskQ(taskmanager.DefaultTaskQConfig(prefix+"_queue"), taskmanager.FactoryMemory))
} else {
opts = append(opts, WithCustomTaskManager(&taskManagerMockBase{}))
opts = append(opts, withTaskManagerMockup())
}

tc, err := ts.createTestClient(
Expand All @@ -358,7 +355,7 @@ func (ts *EmbeddedDBTestSuite) genericMockedDBClient(t *testing.T, database data
),
database, prefix,
true, true, WithDebugging(),
WithCustomTaskManager(&taskManagerMockBase{}),
withTaskManagerMockup(),
)
require.NoError(t, err)
require.NotNil(t, tc)
Expand Down
16 changes: 8 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ type (

// taskManagerOptions holds the configuration for taskmanager
taskManagerOptions struct {
taskmanager.ClientInterface // Client for TaskManager
cronJobs taskmanager.CronJobs // List of cron jobs
options []taskmanager.ClientOps // List of options
cronCustomPeriods map[string]time.Duration // will override the default period of cronJob
taskmanager.TaskManagerInterface // Client for TaskManager
cronJobs taskmanager.CronJobs // List of cron jobs
options []taskmanager.ClientOps // List of options
cronCustomPeriods map[string]time.Duration // will override the default period of cronJob
}
)

Expand Down Expand Up @@ -303,7 +303,7 @@ func (c *Client) Close(ctx context.Context) error {
if err := tm.Close(ctx); err != nil {
return err
}
c.options.taskManager.ClientInterface = nil
c.options.taskManager.TaskManagerInterface = nil
}
return nil
}
Expand Down Expand Up @@ -445,9 +445,9 @@ func (c *Client) SetNotificationsClient(client notifications.ClientInterface) {
}

// Taskmanager will return the Taskmanager if it exists
func (c *Client) Taskmanager() taskmanager.ClientInterface {
if c.options.taskManager != nil && c.options.taskManager.ClientInterface != nil {
return c.options.taskManager.ClientInterface
func (c *Client) Taskmanager() taskmanager.TaskManagerInterface {
if c.options.taskManager != nil && c.options.taskManager.TaskManagerInterface != nil {
return c.options.taskManager.TaskManagerInterface
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions client_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func (c *Client) loadPaymailClient() (err error) {
// loadTaskmanager will load the TaskManager and start the TaskManager client
func (c *Client) loadTaskmanager(ctx context.Context) (err error) {
// Load if a custom interface was NOT provided
if c.options.taskManager.ClientInterface == nil {
c.options.taskManager.ClientInterface, err = taskmanager.NewClient(
if c.options.taskManager.TaskManagerInterface == nil {
c.options.taskManager.TaskManagerInterface, err = taskmanager.NewClient(
ctx, c.options.taskManager.options...,
)
}
Expand Down
13 changes: 2 additions & 11 deletions client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func defaultClientOptions() *clientOptions {

// Blank TaskManager config
taskManager: &taskManagerOptions{
ClientInterface: nil,
cronCustomPeriods: map[string]time.Duration{},
TaskManagerInterface: nil,
cronCustomPeriods: map[string]time.Duration{},
},

// Default user agent
Expand Down Expand Up @@ -532,15 +532,6 @@ func WithPaymailServerConfig(config *server.Configuration, defaultFromPaymail, d
// TASK MANAGER
// -----------------------------------------------------------------

// WithCustomTaskManager will set the taskmanager
func WithCustomTaskManager(taskManager taskmanager.ClientInterface) ClientOps {
return func(c *clientOptions) {
if taskManager != nil {
c.taskManager.ClientInterface = taskManager
}
}
}

// WithTaskQ will set the task manager to use TaskQ & in-memory
func WithTaskQ(config *taskq.QueueOptions, factory taskmanager.Factory) ClientOps {
return func(c *clientOptions) {
Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type ClientService interface {
Logger() *zerolog.Logger
Notifications() notifications.ClientInterface
PaymailClient() paymail.ClientInterface
Taskmanager() taskmanager.ClientInterface
Taskmanager() taskmanager.TaskManagerInterface
}

// DestinationService is the destination actions
Expand Down
8 changes: 4 additions & 4 deletions model_access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_newAccessKey(t *testing.T) {
})

t.Run("save", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

key := newAccessKey(testXPubID, append(
Expand All @@ -56,7 +56,7 @@ func Test_newAccessKey(t *testing.T) {
})

t.Run("revoke", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

key := newAccessKey(testXPubID, append(client.DefaultModelOptions(), New())...)
Expand Down Expand Up @@ -88,7 +88,7 @@ func Test_newAccessKey(t *testing.T) {
// TestAccessKey_GetAccessKey will test the method getAccessKey()
func TestAccessKey_GetAccessKey(t *testing.T) {
t.Run("not found", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()
accessKey, err := getAccessKey(ctx, testXPubID, client.DefaultModelOptions()...)
require.NoError(t, err)
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestAccessKey_GetAccessKey(t *testing.T) {
// TestAccessKey_GetAccessKeys will test the method getAccessKeysByXPubID()
func TestAccessKey_GetAccessKeys(t *testing.T) {
t.Run("not found", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()
accessKey, err := getAccessKeysByXPubID(ctx, testXPubID, nil, nil, nil, client.DefaultModelOptions()...)
require.NoError(t, err)
Expand Down
38 changes: 17 additions & 21 deletions model_destinations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import (

// todo: finish unit tests!

var testLockingScript = "76a9147ff514e6ae3deb46e6644caac5cdd0bf2388906588ac"
var testAddressID = "fc1e635d98151c6008f29908ee2928c60c745266f9853e945c917b1baa05973e"
var testDestinationID = "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
var stasHex = "76a9146d3562a8ec96bcb3b2253fd34f38a556fb66733d88ac6976aa607f5f7f7c5e7f7c5d7f7c5c7f7c5b7f7c5a7f7c597f7c587f7c577f7c567f7c557f7c547f7c537f7c527f7c517f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7c5f7f7c5e7f7c5d7f7c5c7f7c5b7f7c5a7f7c597f7c587f7c577f7c567f7c557f7c547f7c537f7c527f7c517f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e01007e818b21414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff007d976e7c5296a06394677768827601249301307c7e23022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798027e7c7e7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e01417e21038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218ad547f7701207f01207f7701247f517f7801007e8102fd00a063546752687f7801007e817f727e7b01177f777b557a766471567a577a786354807e7e676d68aa880067765158a569765187645294567a5379587a7e7e78637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6867567a6876aa587a7d54807e577a597a5a7a786354807e6f7e7eaa727c7e676d6e7eaa7c687b7eaa587a7d877663516752687c72879b69537a647500687c7b547f77517f7853a0916901247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f77788c6301247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f777852946301247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f77686877517f7c52797d8b9f7c53a09b91697c76638c7c587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f777c6876638c7c587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f777c6863587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f7768587f517f7801007e817602fc00a06302fd00a063546752687f7801007e81727e7b7b687f75537f7c0376a9148801147f775379645579887567726881766968789263556753687a76026c057f7701147f8263517f7c766301007e817f7c6775006877686b537992635379528763547a6b547a6b677c6b567a6b537a7c717c71716868547a587f7c81547a557964936755795187637c686b687c547f7701207f75748c7a7669765880748c7a76567a876457790376a9147e7c7e557967041976a9147c7e0288ac687e7e5579636c766976748c7a9d58807e6c0376a9147e748c7a7e6c7e7e676c766b8263828c007c80517e846864745aa0637c748c7a76697d937b7b58807e56790376a9147e748c7a7e55797e7e6868686c567a5187637500678263828c007c80517e846868647459a0637c748c7a76697d937b7b58807e55790376a9147e748c7a7e55797e7e687459a0637c748c7a76697d937b7b58807e55790376a9147e748c7a7e55797e7e68687c537a9d547963557958807e041976a91455797e0288ac7e7e68aa87726d77776a14f566909f378788e61108d619e40df2757455d14c010005546f6b656e"
var (
testLockingScript = "76a9147ff514e6ae3deb46e6644caac5cdd0bf2388906588ac"
testAddressID = "fc1e635d98151c6008f29908ee2928c60c745266f9853e945c917b1baa05973e"
testDestinationID = "c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646"
stasHex = "76a9146d3562a8ec96bcb3b2253fd34f38a556fb66733d88ac6976aa607f5f7f7c5e7f7c5d7f7c5c7f7c5b7f7c5a7f7c597f7c587f7c577f7c567f7c557f7c547f7c537f7c527f7c517f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7c5f7f7c5e7f7c5d7f7c5c7f7c5b7f7c5a7f7c597f7c587f7c577f7c567f7c557f7c547f7c537f7c527f7c517f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e01007e818b21414136d08c5ed2bf3ba048afe6dcaebafeffffffffffffffffffffffffffffff007d976e7c5296a06394677768827601249301307c7e23022079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798027e7c7e7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c8276638c687f7c7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e01417e21038ff83d8cf12121491609c4939dc11c4aa35503508fe432dc5a5c1905608b9218ad547f7701207f01207f7701247f517f7801007e8102fd00a063546752687f7801007e817f727e7b01177f777b557a766471567a577a786354807e7e676d68aa880067765158a569765187645294567a5379587a7e7e78637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6878637c8c7c53797e577a7e6867567a6876aa587a7d54807e577a597a5a7a786354807e6f7e7eaa727c7e676d6e7eaa7c687b7eaa587a7d877663516752687c72879b69537a647500687c7b547f77517f7853a0916901247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f77788c6301247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f777852946301247f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e816854937f77686877517f7c52797d8b9f7c53a09b91697c76638c7c587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f777c6876638c7c587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f777c6863587f77517f7c01007e817602fc00a06302fd00a063546752687f7c01007e81687f7768587f517f7801007e817602fc00a06302fd00a063546752687f7801007e81727e7b7b687f75537f7c0376a9148801147f775379645579887567726881766968789263556753687a76026c057f7701147f8263517f7c766301007e817f7c6775006877686b537992635379528763547a6b547a6b677c6b567a6b537a7c717c71716868547a587f7c81547a557964936755795187637c686b687c547f7701207f75748c7a7669765880748c7a76567a876457790376a9147e7c7e557967041976a9147c7e0288ac687e7e5579636c766976748c7a9d58807e6c0376a9147e748c7a7e6c7e7e676c766b8263828c007c80517e846864745aa0637c748c7a76697d937b7b58807e56790376a9147e748c7a7e55797e7e6868686c567a5187637500678263828c007c80517e846868647459a0637c748c7a76697d937b7b58807e55790376a9147e748c7a7e55797e7e687459a0637c748c7a76697d937b7b58807e55790376a9147e748c7a7e55797e7e68687c537a9d547963557958807e041976a91455797e0288ac7e7e68aa87726d77776a14f566909f378788e61108d619e40df2757455d14c010005546f6b656e"
)

// TestDestination_newDestination will test the method newDestination()
func TestDestination_newDestination(t *testing.T) {
Expand Down Expand Up @@ -86,7 +88,6 @@ func TestDestination_newAddress(t *testing.T) {
assert.Equal(t, bscript2.ScriptTypePubKeyHash, address.Type)
assert.Equal(t, testAddressID, address.GetID())
})

}

// TestDestination_GetModelName will test the method GetModelName()
Expand Down Expand Up @@ -126,7 +127,6 @@ func TestDestination_GetID(t *testing.T) {

// TestDestination_setAddress will test the method setAddress()
func TestDestination_setAddress(t *testing.T) {

t.Run("internal 1", func(t *testing.T) {
destination := newDestination(testXPubID, testLockingScript)
destination.Chain = utils.ChainInternal
Expand Down Expand Up @@ -166,9 +166,8 @@ func TestDestination_setAddress(t *testing.T) {

// TestDestination_getDestinationByID will test the method getDestinationByID()
func TestDestination_getDestinationByID(t *testing.T) {

t.Run("does not exist", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

xPub, err := getDestinationByID(ctx, testDestinationID, client.DefaultModelOptions()...)
Expand All @@ -177,7 +176,7 @@ func TestDestination_getDestinationByID(t *testing.T) {
})

t.Run("get", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

destination := newDestination(testXPubID, testLockingScript, client.DefaultModelOptions()...)
Expand All @@ -198,9 +197,8 @@ func TestDestination_getDestinationByID(t *testing.T) {

// TestDestination_getDestinationByAddress will test the method getDestinationByAddress()
func TestDestination_getDestinationByAddress(t *testing.T) {

t.Run("does not exist", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

xPub, err := getDestinationByAddress(ctx, testExternalAddress, client.DefaultModelOptions()...)
Expand All @@ -209,7 +207,7 @@ func TestDestination_getDestinationByAddress(t *testing.T) {
})

t.Run("get", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

destination := newDestination(testXPubID, testLockingScript, client.DefaultModelOptions()...)
Expand All @@ -230,9 +228,8 @@ func TestDestination_getDestinationByAddress(t *testing.T) {

// TestDestination_getDestinationByLockingScript will test the method getDestinationByLockingScript()
func TestDestination_getDestinationByLockingScript(t *testing.T) {

t.Run("does not exist", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

xPub, err := getDestinationByLockingScript(ctx, testLockingScript, client.DefaultModelOptions()...)
Expand All @@ -241,7 +238,7 @@ func TestDestination_getDestinationByLockingScript(t *testing.T) {
})

t.Run("get destination", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, false, withTaskManagerMockup())
defer deferMe()

destination := newDestination(testXPubID, testLockingScript, client.DefaultModelOptions()...)
Expand Down Expand Up @@ -269,9 +266,8 @@ func BenchmarkDestination_newAddress(b *testing.B) {

// TestClient_NewDestination will test the method NewDestination()
func TestClient_NewDestination(t *testing.T) {

t.Run("valid - simple destination", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, withTaskManagerMockup())
defer deferMe()

// Get new random key
Expand Down Expand Up @@ -304,7 +300,7 @@ func TestClient_NewDestination(t *testing.T) {
})

t.Run("error - invalid xPub", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, withTaskManagerMockup())
defer deferMe()

opts := append(
Expand All @@ -324,7 +320,7 @@ func TestClient_NewDestination(t *testing.T) {
})

t.Run("error - xPub not found", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, withTaskManagerMockup())
defer deferMe()

opts := append(
Expand All @@ -345,7 +341,7 @@ func TestClient_NewDestination(t *testing.T) {
})

t.Run("error - unsupported destination type", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, withTaskManagerMockup())
defer deferMe()

// Get new random key
Expand All @@ -369,7 +365,7 @@ func TestClient_NewDestination(t *testing.T) {
})

t.Run("stas token", func(t *testing.T) {
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, WithCustomTaskManager(&taskManagerMockBase{}))
ctx, client, deferMe := CreateTestSQLiteClient(t, false, true, withTaskManagerMockup())
defer deferMe()

// Get new random key
Expand Down
Loading

0 comments on commit 940725b

Please sign in to comment.