From 02294c3a1956b4b84cb408998f5116bd2c09aaee Mon Sep 17 00:00:00 2001 From: Daniel Tafoya Date: Fri, 13 Dec 2024 02:46:49 -0500 Subject: [PATCH] create token --- comp/process/apiserver/apiserver_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comp/process/apiserver/apiserver_test.go b/comp/process/apiserver/apiserver_test.go index da5040b2653149..a1b780065a6c5d 100644 --- a/comp/process/apiserver/apiserver_test.go +++ b/comp/process/apiserver/apiserver_test.go @@ -48,7 +48,7 @@ func TestLifecycle(t *testing.T) { // With authentication req, err := http.NewRequest("GET", "http://localhost:6162/config", nil) require.NoError(c, err) - util.SetAuthToken(pkgconfigsetup.Datadog()) + util.CreateAndSetAuthToken(pkgconfigsetup.Datadog()) req.Header.Set("Authorization", "Bearer "+util.GetAuthToken()) res, err := util.GetClient(false).Do(req) require.NoError(c, err) @@ -84,7 +84,7 @@ func TestAuthentication(t *testing.T) { assert.Equal(c, http.StatusUnauthorized, res.StatusCode) // With authentication - util.SetAuthToken(pkgconfigsetup.Datadog()) + util.CreateAndSetAuthToken(pkgconfigsetup.Datadog()) req.Header.Set("Authorization", "Bearer "+util.GetAuthToken()) res, err = util.GetClient(false).Do(req) require.NoError(c, err)