Skip to content

Commit

Permalink
Change unit test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Sep 19, 2024
1 parent eb2c025 commit ba13964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/pkg/api/handleCheckin.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"github.com/miolini/datacounter"
"github.com/rs/zerolog"

"go.elastic.co/apm/module/apmhttp/v2"
"go.elastic.co/apm/v2"
apmhttp "go.elastic.co/apm/module/apmhttp/v2"
apm "go.elastic.co/apm/v2"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/policy/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestGetPolicyInputsWithSecretsAndStreams(t *testing.T) {
result, keys, _ := getPolicyInputsWithSecrets(context.TODO(), &pData, bulker)

assert.Equal(t, expectedResult, result)
assert.Equal(t, []string{"inputs[0].package_var_secret", "inputs[0].input_var_secret", "inputs[1].streams[0].package_var_secret", "inputs[1].streams[0].input_var_secret", "inputs[1].streams[0].stream_var_secret"}, keys)
assert.ElementsMatch(t, []string{"inputs[0].package_var_secret", "inputs[0].input_var_secret", "inputs[1].streams[0].package_var_secret", "inputs[1].streams[0].input_var_secret", "inputs[1].streams[0].stream_var_secret"}, keys)
assert.Nil(t, pData.SecretReferences)
}

Expand Down Expand Up @@ -177,7 +177,7 @@ func TestPolicyInputSteamsEmbedded(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, expected, result)
assert.Equal(t, []string{"inputs[0].streams[0].embedded.embedded-arr[0].embedded-secret"}, keys)
assert.ElementsMatch(t, []string{"inputs[0].streams[0].embedded.embedded-arr[0].embedded-secret"}, keys)
}

func TestGetPolicyInputsNoopWhenNoSecrets(t *testing.T) {
Expand Down Expand Up @@ -271,7 +271,7 @@ func TestProcessOutputSecret(t *testing.T) {
assert.NoError(t, err)

assert.Equal(t, expectOutput, output)
assert.Equal(t, tc.expectKeys, keys)
assert.ElementsMatch(t, tc.expectKeys, keys)
})
}
}

0 comments on commit ba13964

Please sign in to comment.