chore: update test redactor ordering (#1765)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow 2023-04-26 16:42:43 -04:00 committed by GitHub
parent fd02bef0a3
commit 451cb9d5ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,13 +47,14 @@ func AssertEncoderAgainstGoldenImageSnapshot(t *testing.T, format sbom.Format, s
err := format.Encode(&buffer, sbom)
assert.NoError(t, err)
actual := redact(buffer.Bytes(), redactors...)
actual := buffer.Bytes()
// replace the expected snapshot contents with the current encoder contents
if updateSnapshot {
testutils.UpdateGoldenFileContents(t, actual)
}
actual = redact(actual, redactors...)
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
if json {
@ -71,13 +72,14 @@ func AssertEncoderAgainstGoldenSnapshot(t *testing.T, format sbom.Format, sbom s
err := format.Encode(&buffer, sbom)
assert.NoError(t, err)
actual := redact(buffer.Bytes(), redactors...)
actual := buffer.Bytes()
// replace the expected snapshot contents with the current encoder contents
if updateSnapshot {
testutils.UpdateGoldenFileContents(t, actual)
}
actual = redact(actual, redactors...)
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
if json {