From d0905c02ddfb2138637444dd0016c6f94ac103f0 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Thu, 14 Nov 2024 13:07:26 -0800 Subject: [PATCH] use test helper in rest_test.go to reduce some duplication Co-authored-by: Joshua Casey --- internal/registry/clientsecretrequest/rest_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/registry/clientsecretrequest/rest_test.go b/internal/registry/clientsecretrequest/rest_test.go index bf9b05607..c1ee55ad2 100644 --- a/internal/registry/clientsecretrequest/rest_test.go +++ b/internal/registry/clientsecretrequest/rest_test.go @@ -720,7 +720,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-happy-new-secret", "generatedSecret": true, "revokedSecrets": float64(0), @@ -798,7 +797,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-append-new-secret-hash", "generatedSecret": true, "revokedSecrets": float64(0), @@ -873,7 +871,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-append-new-secret-hash", "generatedSecret": true, "revokedSecrets": float64(2), @@ -947,7 +944,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-some-client", "generatedSecret": false, "revokedSecrets": float64(2), @@ -1456,7 +1452,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-some-client", "generatedSecret": true, "revokedSecrets": float64(1), @@ -1534,7 +1529,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-some-client", "generatedSecret": true, "revokedSecrets": float64(5), @@ -1613,7 +1607,6 @@ func TestCreate(t *testing.T) { }, wantAuditLog: []testutil.WantedAuditLog{ testutil.WantAuditLog("OIDCClientSecretRequest Updated Secrets", map[string]any{ - "auditID": "fake-audit-id", "clientID": "client.oauth.pinniped.dev-some-client", "generatedSecret": true, "revokedSecrets": float64(6), @@ -1720,6 +1713,7 @@ func TestCreate(t *testing.T) { requireExactlyOneLogLineWithMultipleSteps(t, logger, tt.wantLogStepSubstrings) + testutil.WantAuditIDOnEveryAuditLog(tt.wantAuditLog, "fake-audit-id") testutil.CompareAuditLogs(t, tt.wantAuditLog, actualAuditLog.String()) }) }