From fbc3334e8caf449d1ceced6711ecb658df846f49 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Petersen" Date: Thu, 2 May 2024 11:33:53 -0400 Subject: [PATCH] Improve TestFuzzAndJSONNewValidEmptyAuthorizeCodeSession message --- .../authorizationcode/authorizationcode_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/fositestorage/authorizationcode/authorizationcode_test.go b/internal/fositestorage/authorizationcode/authorizationcode_test.go index 568393f32..a95d0e970 100644 --- a/internal/fositestorage/authorizationcode/authorizationcode_test.go +++ b/internal/fositestorage/authorizationcode/authorizationcode_test.go @@ -428,7 +428,13 @@ func TestFuzzAndJSONNewValidEmptyAuthorizeCodeSession(t *testing.T) { // cause those old session Secrets to be discarded upon read after an upgrade. // Note that when you change the storage version, you will also need to change it in the JSON content of the // expected value for this assertion. - require.JSONEq(t, ExpectedAuthorizeCodeSessionJSONFromFuzzing, authorizeCodeSessionJSONFromFuzzing, "actual:\n%s", authorizeCodeSessionJSONFromFuzzing) + require.JSONEq(t, + ExpectedAuthorizeCodeSessionJSONFromFuzzing, + authorizeCodeSessionJSONFromFuzzing, + "actual:\n%s\n\n(NOTICE: This test may fail when storage structure is updated. "+ + "Be sure to update relevant version variables (authorizeCodeStorageVersion, oidcStorageVersion, pkceStorageVersion, "+ + "refreshTokenStorageVersion, accessTokenStorageVersion) to a new value and leave a comment documenting the change. "+ + "Updating the version ensures new secret generation, therefore smooth upgrades of Pinniped.)", authorizeCodeSessionJSONFromFuzzing) } func TestReadFromSecret(t *testing.T) {