diff --git a/core/cmd/renderer_test.go b/core/cmd/renderer_test.go index f617747953c..91f5650caa8 100644 --- a/core/cmd/renderer_test.go +++ b/core/cmd/renderer_test.go @@ -37,7 +37,7 @@ func TestRendererTable_RenderConfigurationV2(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) wantUser, wantEffective := app.Config.ConfigTOML() require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) t.Run("effective", func(t *testing.T) { resp, cleanup := client.Get("/v2/config/v2") diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index fc0756004b3..0222fc04c45 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -619,6 +619,10 @@ type User struct { func (ta *TestApplication) NewHTTPClient(user *User) HTTPClientCleaner { ta.t.Helper() + if user == nil { + user = &User{} + } + if user.Email == "" { user.Email = fmt.Sprintf("%s@chainlink.test", uuid.New()) } @@ -647,7 +651,7 @@ func (ta *TestApplication) NewClientOpts() cmd.ClientOpts { // NewShellAndRenderer creates a new cmd.Shell for the test application func (ta *TestApplication) NewShellAndRenderer() (*cmd.Shell, *RendererMock) { - hc := ta.NewHTTPClient(&User{}) + hc := ta.NewHTTPClient(nil) r := &RendererMock{} lggr := logger.TestLogger(ta.t) client := &cmd.Shell{ @@ -809,7 +813,7 @@ func ParseJSONAPIResponseMetaCount(input []byte) (int, error) { func CreateJobViaWeb(t testing.TB, app *TestApplication, request []byte) job.Job { t.Helper() - client := app.NewHTTPClient(&User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/jobs", bytes.NewBuffer(request)) defer cleanup() AssertServerResponse(t, resp, http.StatusOK) @@ -823,7 +827,7 @@ func CreateJobViaWeb(t testing.TB, app *TestApplication, request []byte) job.Job func CreateJobViaWeb2(t testing.TB, app *TestApplication, spec string) webpresenters.JobResource { t.Helper() - client := app.NewHTTPClient(&User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/jobs", bytes.NewBufferString(spec)) defer cleanup() AssertServerResponse(t, resp, http.StatusOK) @@ -837,7 +841,7 @@ func CreateJobViaWeb2(t testing.TB, app *TestApplication, spec string) webpresen func DeleteJobViaWeb(t testing.TB, app *TestApplication, jobID int32) { t.Helper() - client := app.NewHTTPClient(&User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Delete(fmt.Sprintf("/v2/jobs/%v", jobID)) defer cleanup() AssertServerResponse(t, resp, http.StatusNoContent) @@ -886,7 +890,7 @@ func CreateJobRunViaUser( t.Helper() bodyBuf := bytes.NewBufferString(body) - client := app.NewHTTPClient(&User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/jobs/"+jobID.String()+"/runs", bodyBuf) defer cleanup() AssertServerResponse(t, resp, 200) @@ -905,7 +909,7 @@ func CreateExternalInitiatorViaWeb( ) *webpresenters.ExternalInitiatorAuthentication { t.Helper() - client := app.NewHTTPClient(&User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post( "/v2/external_initiators", bytes.NewBufferString(payload), diff --git a/core/services/job/runner_integration_test.go b/core/services/job/runner_integration_test.go index ba7a216feca..05782f95ce8 100644 --- a/core/services/job/runner_integration_test.go +++ b/core/services/job/runner_integration_test.go @@ -911,7 +911,7 @@ func TestRunner_Success_Callback_AsyncJob(t *testing.T) { { url, err := url.Parse(responseURL) require.NoError(t, err) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) body := strings.NewReader(`{"value": {"data":{"result":"123.45"}}}`) response, cleanup := client.Patch(url.Path, body) defer cleanup() @@ -1092,7 +1092,7 @@ func TestRunner_Error_Callback_AsyncJob(t *testing.T) { { url, err := url.Parse(responseURL) require.NoError(t, err) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) body := strings.NewReader(`{"error": "something exploded in EA"}`) response, cleanup := client.Patch(url.Path, body) defer cleanup() diff --git a/core/web/auth/auth_test.go b/core/web/auth/auth_test.go index ce369fce1b2..67660971907 100644 --- a/core/web/auth/auth_test.go +++ b/core/web/auth/auth_test.go @@ -307,7 +307,7 @@ func TestRBAC_Routemap_Admin(t *testing.T) { // Assert all admin routes // no endpoint should return StatusUnauthorized - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) for _, route := range routesRolesMap { func() { var resp *http.Response diff --git a/core/web/bridge_types_controller_test.go b/core/web/bridge_types_controller_test.go index e0048cc64d4..6459cad0545 100644 --- a/core/web/bridge_types_controller_test.go +++ b/core/web/bridge_types_controller_test.go @@ -135,7 +135,7 @@ func TestValidateBridgeNotExist(t *testing.T) { func BenchmarkBridgeTypesController_Index(b *testing.B) { app := cltest.NewApplication(b) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) b.ResetTimer() for n := 0; n < b.N; n++ { @@ -150,7 +150,7 @@ func TestBridgeTypesController_Index(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) bt, err := setupBridgeControllerIndex(t, app.BridgeORM()) assert.NoError(t, err) @@ -218,7 +218,7 @@ func TestBridgeTypesController_Create_Success(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post( "/v2/bridge_types", @@ -246,7 +246,7 @@ func TestBridgeTypesController_Update_Success(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) bridgeName := testutils.RandomizeName("BRidgea") bt := &bridges.BridgeType{ @@ -272,7 +272,7 @@ func TestBridgeController_Show(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) bt := &bridges.BridgeType{ Name: bridges.MustParseBridgeName(testutils.RandomizeName("showbridge")), @@ -302,7 +302,7 @@ func TestBridgeTypesController_Create_AdapterExistsError(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post( "/v2/bridge_types", @@ -318,7 +318,7 @@ func TestBridgeTypesController_Create_BindJSONError(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post( "/v2/bridge_types", @@ -334,7 +334,7 @@ func TestBridgeTypesController_Create_DatabaseError(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post( "/v2/bridge_types", diff --git a/core/web/build_info_controller_test.go b/core/web/build_info_controller_test.go index 9a71951ed3d..e2d2cb0e631 100644 --- a/core/web/build_info_controller_test.go +++ b/core/web/build_info_controller_test.go @@ -18,7 +18,7 @@ func TestBuildInfoController_Show_APICredentials(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/build_info") defer cleanup() diff --git a/core/web/cors_test.go b/core/web/cors_test.go index 120a27c645b..cfd82dd8b71 100644 --- a/core/web/cors_test.go +++ b/core/web/cors_test.go @@ -29,7 +29,7 @@ func TestCors_DefaultOrigins(t *testing.T) { t.Run(test.origin, func(t *testing.T) { app := cltest.NewApplicationWithConfig(t, config) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) headers := map[string]string{"Origin": test.origin} resp, cleanup := client.Get("/v2/chains/evm", headers) @@ -61,7 +61,7 @@ func TestCors_OverrideOrigins(t *testing.T) { }) app := cltest.NewApplicationWithConfig(t, config) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) headers := map[string]string{"Origin": test.origin} resp, cleanup := client.Get("/v2/chains/evm", headers) diff --git a/core/web/cosmos_chains_controller_test.go b/core/web/cosmos_chains_controller_test.go index f443fb64228..f3f5909940f 100644 --- a/core/web/cosmos_chains_controller_test.go +++ b/core/web/cosmos_chains_controller_test.go @@ -185,7 +185,7 @@ func setupCosmosChainsControllerTestV2(t *testing.T, cfgs ...*cosmos.CosmosConfi app := cltest.NewApplicationWithConfig(t, cfg) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return &TestCosmosChainsController{ app: app, diff --git a/core/web/cosmos_keys_controller_test.go b/core/web/cosmos_keys_controller_test.go index 479ee686d57..af421416388 100644 --- a/core/web/cosmos_keys_controller_test.go +++ b/core/web/cosmos_keys_controller_test.go @@ -41,7 +41,7 @@ func TestCosmosKeysController_Create_HappyPath(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) keyStore := app.GetKeyStore() response, cleanup := client.Post("/v2/keys/cosmos", nil) @@ -98,7 +98,7 @@ func setupCosmosKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, key require.NoError(t, app.Start(testutils.Context(t))) require.NoError(t, app.KeyStore.Cosmos().Add(cltest.DefaultCosmosKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/dkgencrypt_keys_controller_test.go b/core/web/dkgencrypt_keys_controller_test.go index 5d8b1ab2328..41d7eb4a752 100644 --- a/core/web/dkgencrypt_keys_controller_test.go +++ b/core/web/dkgencrypt_keys_controller_test.go @@ -103,7 +103,7 @@ func setupDKGEncryptKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, require.NoError(t, app.Start(testutils.Context(t))) require.NoError(t, app.KeyStore.DKGEncrypt().Add(cltest.DefaultDKGEncryptKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/dkgsign_keys_controller_test.go b/core/web/dkgsign_keys_controller_test.go index 0d6d167df99..611c5b3ef0a 100644 --- a/core/web/dkgsign_keys_controller_test.go +++ b/core/web/dkgsign_keys_controller_test.go @@ -103,7 +103,7 @@ func setupDKGSignKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, ke require.NoError(t, app.Start(testutils.Context(t))) require.NoError(t, app.KeyStore.DKGSign().Add(cltest.DefaultDKGSignKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/eth_keys_controller_test.go b/core/web/eth_keys_controller_test.go index 4d69591999e..98641721737 100644 --- a/core/web/eth_keys_controller_test.go +++ b/core/web/eth_keys_controller_test.go @@ -56,7 +56,7 @@ func TestETHKeysController_Index_Success(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/keys/evm") defer cleanup() require.Equal(t, http.StatusOK, resp.StatusCode) @@ -100,7 +100,7 @@ func TestETHKeysController_Index_Errors(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/keys/eth") defer cleanup() require.Equal(t, http.StatusOK, resp.StatusCode) @@ -134,7 +134,7 @@ func TestETHKeysController_Index_Disabled(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/keys/eth") defer cleanup() require.Equal(t, http.StatusOK, resp.StatusCode) @@ -169,7 +169,7 @@ func TestETHKeysController_Index_NotDev(t *testing.T) { app := cltest.NewApplicationWithConfigAndKey(t, cfg, ethClient) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/keys/eth") defer cleanup() require.Equal(t, http.StatusOK, resp.StatusCode) @@ -194,7 +194,7 @@ func TestETHKeysController_Index_NoAccounts(t *testing.T) { app := cltest.NewApplication(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/keys/eth") defer cleanup() @@ -224,7 +224,7 @@ func TestETHKeysController_CreateSuccess(t *testing.T) { linkBalance := assets.NewLinkFromJuels(42) ethClient.On("LINKBalance", mock.Anything, mock.Anything, mock.Anything).Return(linkBalance, nil) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) require.NoError(t, app.Start(testutils.Context(t))) @@ -267,7 +267,7 @@ func TestETHKeysController_ChainSuccess_UpdateNonce(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -309,7 +309,7 @@ func TestETHKeysController_ChainSuccess_Disable(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -352,7 +352,7 @@ func TestETHKeysController_ChainSuccess_Enable(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -416,7 +416,7 @@ func TestETHKeysController_ChainSuccess_ResetWithAbandon(t *testing.T) { require.NoError(t, err) assert.Equal(t, 0, count) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -461,7 +461,7 @@ func TestETHKeysController_ChainFailure_InvalidAbandon(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -494,7 +494,7 @@ func TestETHKeysController_ChainFailure_InvalidEnabled(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -523,7 +523,7 @@ func TestETHKeysController_ChainFailure_InvalidAddress(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -551,7 +551,7 @@ func TestETHKeysController_ChainFailure_MissingAddress(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -579,7 +579,7 @@ func TestETHKeysController_ChainFailure_InvalidChainID(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -611,7 +611,7 @@ func TestETHKeysController_ChainFailure_MissingChainID(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/chain"} query := chainURL.Query() @@ -647,7 +647,7 @@ func TestETHKeysController_DeleteSuccess(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/" + addr0.Hex()} resp, cleanup := client.Delete(chainURL.String()) defer cleanup() @@ -688,7 +688,7 @@ func TestETHKeysController_DeleteFailure_InvalidAddress(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm" + "/bad_address"} resp, cleanup := client.Delete(chainURL.String()) @@ -709,7 +709,7 @@ func TestETHKeysController_DeleteFailure_KeyMissing(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) chainURL := url.URL{Path: "/v2/keys/evm/" + testutils.NewAddress().Hex()} resp, cleanup := client.Delete(chainURL.String()) diff --git a/core/web/evm_chains_controller_test.go b/core/web/evm_chains_controller_test.go index 02e493a43b2..4ebf06f2b6d 100644 --- a/core/web/evm_chains_controller_test.go +++ b/core/web/evm_chains_controller_test.go @@ -204,7 +204,7 @@ func setupEVMChainsControllerTest(t *testing.T, cfg chainlink.GeneralConfig) *Te app := cltest.NewApplicationWithConfig(t, cfg) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return &TestEVMChainsController{ app: app, diff --git a/core/web/evm_forwarders_controller_test.go b/core/web/evm_forwarders_controller_test.go index 8927c014022..1f4dd744d98 100644 --- a/core/web/evm_forwarders_controller_test.go +++ b/core/web/evm_forwarders_controller_test.go @@ -32,7 +32,7 @@ func setupEVMForwardersControllerTest(t *testing.T, overrideFn func(c *chainlink app := cltest.NewApplicationWithConfig(t, configtest.NewGeneralConfig(t, overrideFn)) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return &TestEVMForwardersController{ app: app, diff --git a/core/web/evm_transactions_controller_test.go b/core/web/evm_transactions_controller_test.go index 2668d66c0e6..9d8336325e2 100644 --- a/core/web/evm_transactions_controller_test.go +++ b/core/web/evm_transactions_controller_test.go @@ -27,7 +27,7 @@ func TestTransactionsController_Index_Success(t *testing.T) { db := app.GetSqlxDB() txStore := cltest.NewTestTxStore(t, app.GetSqlxDB(), app.GetConfig().Database()) ethKeyStore := cltest.NewKeyStore(t, db, app.Config.Database()).Eth() - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) _, from := cltest.MustInsertRandomKey(t, ethKeyStore) cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, txStore, 0, 1, from) // tx1 @@ -69,7 +69,7 @@ func TestTransactionsController_Index_Error(t *testing.T) { app := cltest.NewApplicationWithKey(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/transactions?size=TrainingDay") t.Cleanup(cleanup) cltest.AssertServerResponse(t, resp, 422) @@ -82,7 +82,7 @@ func TestTransactionsController_Show_Success(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) txStore := cltest.NewTestTxStore(t, app.GetSqlxDB(), app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) _, from := cltest.MustInsertRandomKey(t, app.KeyStore.Eth()) tx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, from) @@ -115,7 +115,7 @@ func TestTransactionsController_Show_NotFound(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) txStore := cltest.NewTestTxStore(t, app.GetSqlxDB(), app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) _, from := cltest.MustInsertRandomKey(t, app.KeyStore.Eth()) tx := cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, txStore, 1, from) require.Len(t, tx.TxAttempts, 1) diff --git a/core/web/evm_transfer_controller_test.go b/core/web/evm_transfer_controller_test.go index 3779703c464..0f3cdc8bb69 100644 --- a/core/web/evm_transfer_controller_test.go +++ b/core/web/evm_transfer_controller_test.go @@ -45,7 +45,7 @@ func TestTransfersController_CreateSuccess_From(t *testing.T) { app := cltest.NewApplicationWithKey(t, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount, err := assets.NewEthValueS("100") require.NoError(t, err) @@ -87,7 +87,7 @@ func TestTransfersController_CreateSuccess_From_WEI(t *testing.T) { app := cltest.NewApplicationWithKey(t, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount := assets.NewEthValue(1000000000000000000) @@ -132,7 +132,7 @@ func TestTransfersController_CreateSuccess_From_BalanceMonitorDisabled(t *testin app := cltest.NewApplicationWithConfigAndKey(t, config, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount, err := assets.NewEthValueS("100") require.NoError(t, err) @@ -167,7 +167,7 @@ func TestTransfersController_TransferZeroAddressError(t *testing.T) { amount, err := assets.NewEthValueS("100") require.NoError(t, err) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) request := models.SendEtherRequest{ DestinationAddress: common.HexToAddress("0xFA01FA015C8A5332987319823728982379128371"), FromAddress: common.HexToAddress("0x0000000000000000000000000000000000000000"), @@ -197,7 +197,7 @@ func TestTransfersController_TransferBalanceToLowError(t *testing.T) { app := cltest.NewApplicationWithKey(t, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount, err := assets.NewEthValueS("100") require.NoError(t, err) @@ -235,7 +235,7 @@ func TestTransfersController_TransferBalanceToLowError_ZeroBalance(t *testing.T) app := cltest.NewApplicationWithKey(t, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount, err := assets.NewEthValueS("100") require.NoError(t, err) @@ -263,7 +263,7 @@ func TestTransfersController_JSONBindingError(t *testing.T) { app := cltest.NewApplicationWithKey(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/transfers", bytes.NewBuffer([]byte(`{"address":""}`))) t.Cleanup(cleanup) @@ -297,7 +297,7 @@ func TestTransfersController_CreateSuccess_eip1559(t *testing.T) { app := cltest.NewApplicationWithConfigAndKey(t, config, ethClient, key) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) amount, err := assets.NewEthValueS("100") require.NoError(t, err) diff --git a/core/web/evm_tx_attempts_controller_test.go b/core/web/evm_tx_attempts_controller_test.go index f9aafc5bda1..6c073b3ac41 100644 --- a/core/web/evm_tx_attempts_controller_test.go +++ b/core/web/evm_tx_attempts_controller_test.go @@ -21,7 +21,7 @@ func TestTxAttemptsController_Index_Success(t *testing.T) { require.NoError(t, app.Start(testutils.Context(t))) txStore := cltest.NewTestTxStore(t, app.GetSqlxDB(), app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) _, from := cltest.MustInsertRandomKey(t, app.KeyStore.Eth()) @@ -51,7 +51,7 @@ func TestTxAttemptsController_Index_Error(t *testing.T) { app := cltest.NewApplicationWithKey(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/tx_attempts?size=TrainingDay") t.Cleanup(cleanup) cltest.AssertServerResponse(t, resp, 422) diff --git a/core/web/external_initiators_controller_test.go b/core/web/external_initiators_controller_test.go index bc7d46a4f91..2229b40b7ef 100644 --- a/core/web/external_initiators_controller_test.go +++ b/core/web/external_initiators_controller_test.go @@ -74,7 +74,7 @@ func TestExternalInitiatorsController_Index(t *testing.T) { })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) db := app.GetSqlxDB() borm := bridges.NewORM(db, logger.TestLogger(t), app.GetConfig().Database()) @@ -140,7 +140,7 @@ func TestExternalInitiatorsController_Create_success(t *testing.T) { })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/external_initiators", bytes.NewBufferString(`{"name":"bitcoin","url":"http://without.a.name"}`), @@ -168,7 +168,7 @@ func TestExternalInitiatorsController_Create_without_URL(t *testing.T) { })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/external_initiators", bytes.NewBufferString(`{"name":"no-url"}`), @@ -196,7 +196,7 @@ func TestExternalInitiatorsController_Create_invalid(t *testing.T) { })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/external_initiators", bytes.NewBufferString(`{"url":"http://without.a.name"}`), @@ -220,7 +220,7 @@ func TestExternalInitiatorsController_Delete(t *testing.T) { err := app.BridgeORM().CreateExternalInitiator(&exi) require.NoError(t, err) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Delete("/v2/external_initiators/" + exi.Name) t.Cleanup(cleanup) @@ -236,7 +236,7 @@ func TestExternalInitiatorsController_DeleteNotFound(t *testing.T) { })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) tests := []struct { Name string diff --git a/core/web/features_controller_test.go b/core/web/features_controller_test.go index 33520093347..8ef2e08d394 100644 --- a/core/web/features_controller_test.go +++ b/core/web/features_controller_test.go @@ -21,7 +21,7 @@ func Test_FeaturesController_List(t *testing.T) { c.Feature.UICSAKeys = &csa })) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/features") t.Cleanup(cleanup) diff --git a/core/web/health_controller_test.go b/core/web/health_controller_test.go index 5f915dfedce..d380b279d00 100644 --- a/core/web/health_controller_test.go +++ b/core/web/health_controller_test.go @@ -40,7 +40,7 @@ func TestHealthController_Readyz(t *testing.T) { app.HealthChecker = healthChecker require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/readyz") t.Cleanup(cleanup) assert.Equal(t, tc.status, resp.StatusCode) diff --git a/core/web/jobs_controller_test.go b/core/web/jobs_controller_test.go index ca2bd818a83..d650d50abbf 100644 --- a/core/web/jobs_controller_test.go +++ b/core/web/jobs_controller_test.go @@ -17,10 +17,11 @@ import ( "github.com/google/uuid" p2ppeer "github.com/libp2p/go-libp2p-core/peer" "github.com/pelletier/go-toml" - "github.com/smartcontractkit/sqlx" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/smartcontractkit/sqlx" + "github.com/smartcontractkit/chainlink/v2/core/internal/cltest" "github.com/smartcontractkit/chainlink/v2/core/internal/testutils" configtest "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest/v2" @@ -359,7 +360,7 @@ func TestJobsController_Create_WebhookSpec(t *testing.T) { _, fetchBridge := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) _, submitBridge := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) tomlStr := fmt.Sprintf(testspecs.WebhookSpecNoBody, fetchBridge.Name.String(), submitBridge.Name.String()) body, _ := json.Marshal(web.CreateJobRequest{ @@ -382,7 +383,7 @@ func TestJobsController_FailToCreate_EmptyJsonAttribute(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) tomlBytes := cltest.MustReadFile(t, "../testdata/tomlspecs/webhook-job-spec-with-empty-json.toml") body, _ := json.Marshal(web.CreateJobRequest{ @@ -493,7 +494,7 @@ func TestJobsController_Update_HappyPath(t *testing.T) { _, bridge := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) _, bridge2 := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) var jb job.Job ocrspec := testspecs.GenerateOCRSpec(testspecs.OCRSpecParams{ @@ -555,7 +556,7 @@ func TestJobsController_Update_NonExistentID(t *testing.T) { _, bridge := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) _, bridge2 := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) var jb job.Job ocrspec := testspecs.GenerateOCRSpec(testspecs.OCRSpecParams{ @@ -635,7 +636,7 @@ func setupJobsControllerTests(t *testing.T) (ta *cltest.TestApplication, cc clte app := cltest.NewApplicationWithConfigAndKey(t, cfg, cltest.DefaultP2PKey) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) vrfKeyStore := app.GetKeyStore().VRF() _, err := vrfKeyStore.Create() require.NoError(t, err) @@ -656,7 +657,7 @@ func setupJobSpecsControllerTestsWithJobs(t *testing.T) (*cltest.TestApplication _, bridge := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) _, bridge2 := cltest.MustCreateBridge(t, app.GetSqlxDB(), cltest.BridgeOpts{}, app.GetConfig().Database()) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) var jb job.Job ocrspec := testspecs.GenerateOCRSpec(testspecs.OCRSpecParams{DS1BridgeName: bridge.Name.String(), DS2BridgeName: bridge2.Name.String(), EVMChainID: testutils.FixtureChainID.String()}) diff --git a/core/web/log_controller_test.go b/core/web/log_controller_test.go index 029dc4e8d3f..e4cd1768cef 100644 --- a/core/web/log_controller_test.go +++ b/core/web/log_controller_test.go @@ -41,7 +41,7 @@ func TestLogController_GetLogConfig(t *testing.T) { app := cltest.NewApplicationWithConfig(t, cfg) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, err := client.HTTPClient.Get("/v2/log") require.NoError(t, err) @@ -112,7 +112,7 @@ func TestLogController_PatchLogConfig(t *testing.T) { t.Run(tc.Description, func(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) request := web.LogPatchRequest{Level: tc.logLevel, SqlEnabled: tc.logSql} diff --git a/core/web/loop_registry_test.go b/core/web/loop_registry_test.go index 848579214f3..99036d8c73e 100644 --- a/core/web/loop_registry_test.go +++ b/core/web/loop_registry_test.go @@ -96,7 +96,7 @@ func TestLoopRegistry(t *testing.T) { defer mockLoop.close() mockLoop.run() - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) t.Run("discovery endpoint", func(t *testing.T) { // under the covers this is routing thru the app into loop registry diff --git a/core/web/ocr2_keys_controller_test.go b/core/web/ocr2_keys_controller_test.go index f69ed41f9dd..c7549cd2da5 100644 --- a/core/web/ocr2_keys_controller_test.go +++ b/core/web/ocr2_keys_controller_test.go @@ -101,7 +101,7 @@ func setupOCR2KeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, keyst app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) require.NoError(t, app.KeyStore.OCR2().Add(cltest.DefaultOCR2Key)) diff --git a/core/web/ocr_keys_controller_test.go b/core/web/ocr_keys_controller_test.go index 911947fcb72..ebb671bc1e2 100644 --- a/core/web/ocr_keys_controller_test.go +++ b/core/web/ocr_keys_controller_test.go @@ -89,7 +89,7 @@ func setupOCRKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, keysto app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey)) diff --git a/core/web/p2p_keys_controller_test.go b/core/web/p2p_keys_controller_test.go index 4df5f4d91b2..af15e21a0f6 100644 --- a/core/web/p2p_keys_controller_test.go +++ b/core/web/p2p_keys_controller_test.go @@ -43,7 +43,7 @@ func TestP2PKeysController_Create_HappyPath(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) keyStore := app.GetKeyStore() response, cleanup := client.Post("/v2/keys/p2p", nil) @@ -115,7 +115,7 @@ func setupP2PKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, keysto require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey)) require.NoError(t, app.KeyStore.P2P().Add(cltest.DefaultP2PKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/ping_controller_test.go b/core/web/ping_controller_test.go index 0040f7dfdad..7798c5a672e 100644 --- a/core/web/ping_controller_test.go +++ b/core/web/ping_controller_test.go @@ -22,7 +22,7 @@ func TestPingController_Show_APICredentials(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Get("/v2/ping") defer cleanup() diff --git a/core/web/pipeline_runs_controller_test.go b/core/web/pipeline_runs_controller_test.go index 3efd692c9db..b9212574c05 100644 --- a/core/web/pipeline_runs_controller_test.go +++ b/core/web/pipeline_runs_controller_test.go @@ -70,7 +70,7 @@ func TestPipelineRunsController_CreateWithBody_HappyPath(t *testing.T) { // Make the request { - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) body := strings.NewReader(`{"data":{"result":"123.45"}}`) response, cleanup := client.Post("/v2/jobs/"+uuid.String()+"/runs", body) defer cleanup() @@ -131,7 +131,7 @@ func TestPipelineRunsController_CreateNoBody_HappyPath(t *testing.T) { // Make the request (authorized as user) { - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) response, cleanup := client.Post("/v2/jobs/"+uuid.String()+"/runs", nil) defer cleanup() cltest.AssertServerResponse(t, response, http.StatusOK) @@ -244,7 +244,7 @@ func TestPipelineRunsController_ShowRun_InvalidID(t *testing.T) { t.Parallel() app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) response, cleanup := client.Get("/v2/jobs/1/runs/invalid-run-ID") defer cleanup() @@ -265,7 +265,7 @@ func setupPipelineRunsControllerTests(t *testing.T) (cltest.HTTPClientCleaner, i app := cltest.NewApplicationWithConfigAndKey(t, cfg, ethClient, cltest.DefaultP2PKey) require.NoError(t, app.Start(testutils.Context(t))) require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) key, _ := cltest.MustInsertRandomKey(t, app.KeyStore.Eth()) diff --git a/core/web/router_test.go b/core/web/router_test.go index 424ef4296f4..e08d474154a 100644 --- a/core/web/router_test.go +++ b/core/web/router_test.go @@ -39,7 +39,7 @@ func TestTokenAuthRequired_SessionCredentials(t *testing.T) { ts := httptest.NewServer(router) defer ts.Close() - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) resp, cleanup := client.Post("/v2/bridge_types/", nil) defer cleanup() diff --git a/core/web/solana_chains_controller_test.go b/core/web/solana_chains_controller_test.go index 432fbb45842..78453ad6ddc 100644 --- a/core/web/solana_chains_controller_test.go +++ b/core/web/solana_chains_controller_test.go @@ -186,7 +186,7 @@ func setupSolanaChainsControllerTestV2(t *testing.T, cfgs ...*solana.SolanaConfi app := cltest.NewApplicationWithConfig(t, cfg) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return &TestSolanaChainsController{ app: app, diff --git a/core/web/solana_keys_controller_test.go b/core/web/solana_keys_controller_test.go index b32a844a395..3dfbcfd252a 100644 --- a/core/web/solana_keys_controller_test.go +++ b/core/web/solana_keys_controller_test.go @@ -41,7 +41,7 @@ func TestSolanaKeysController_Create_HappyPath(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) keyStore := app.GetKeyStore() response, cleanup := client.Post("/v2/keys/solana", nil) @@ -99,7 +99,7 @@ func setupSolanaKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, key require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey)) require.NoError(t, app.KeyStore.Solana().Add(cltest.DefaultSolanaKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/starknet_keys_controller_test.go b/core/web/starknet_keys_controller_test.go index c3337e14d2d..a633b4f16c9 100644 --- a/core/web/starknet_keys_controller_test.go +++ b/core/web/starknet_keys_controller_test.go @@ -41,7 +41,7 @@ func TestStarkNetKeysController_Create_HappyPath(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) keyStore := app.GetKeyStore() response, cleanup := client.Post("/v2/keys/starknet", nil) @@ -99,7 +99,7 @@ func setupStarkNetKeysControllerTests(t *testing.T) (cltest.HTTPClientCleaner, k require.NoError(t, app.KeyStore.OCR().Add(cltest.DefaultOCRKey)) require.NoError(t, app.KeyStore.StarkNet().Add(cltest.DefaultStarkNetKey)) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) return client, app.GetKeyStore() } diff --git a/core/web/user_controller_test.go b/core/web/user_controller_test.go index cdb9c9953da..a11082ff6a4 100644 --- a/core/web/user_controller_test.go +++ b/core/web/user_controller_test.go @@ -91,7 +91,7 @@ func TestUserController_CreateUser(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) longPassword := strings.Repeat("x", sessions.MaxBcryptPasswordLength+1) @@ -186,8 +186,7 @@ func TestUserController_UpdateRole(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - u := cltest.User{} - client := app.NewHTTPClient(&u) + client := app.NewHTTPClient(nil) user := cltest.MustRandomUser(t) err := app.SessionORM().CreateUser(&user) require.NoError(t, err) @@ -234,7 +233,7 @@ func TestUserController_DeleteUser(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) user := cltest.MustRandomUser(t) err := app.SessionORM().CreateUser(&user) require.NoError(t, err) @@ -260,7 +259,7 @@ func TestUserController_NewAPIToken(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) req, err := json.Marshal(sessions.ChangeAuthTokenRequest{ Password: cltest.Password, }) @@ -282,7 +281,7 @@ func TestUserController_NewAPIToken_unauthorized(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) req, err := json.Marshal(sessions.ChangeAuthTokenRequest{ Password: "wrong-password", }) @@ -298,7 +297,7 @@ func TestUserController_DeleteAPIKey(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) req, err := json.Marshal(sessions.ChangeAuthTokenRequest{ Password: cltest.Password, }) @@ -315,7 +314,7 @@ func TestUserController_DeleteAPIKey_unauthorized(t *testing.T) { app := cltest.NewApplicationEVMDisabled(t) require.NoError(t, app.Start(testutils.Context(t))) - client := app.NewHTTPClient(&cltest.User{}) + client := app.NewHTTPClient(nil) req, err := json.Marshal(sessions.ChangeAuthTokenRequest{ Password: "wrong-password", })