While reading through the test suite I noticed that EncryptionRecipesTest.cls has two related test-quality issues. I'd like to work on fixing them if the maintainers agree.
1. Tautological assertions that always pass — the three "success" tests (hashRecipesWhenSuccessTest L66, hmacRecipesWhenSuccessTest L107, digitalSignatureRecipesWhenSuccessTest L153) end with System.assert(true, 'No error was expected'), which passes unconditionally and verifies nothing.
Proposal: replace with a meaningful assertion on the generated value (e.g. System.Assert.isNotNull(hmac, ...)).
2. Legacy assertion API — the file uses System.assert() and System.assertEquals() while the rest of the suite uses the modern System.Assert class.
Proposal: migrate to System.Assert class
Scope: limited to force-app/tests/Encryption Recipes/EncryptionRecipesTest.cls
Happy to adjust the scope based on your preference.
While reading through the test suite I noticed that
EncryptionRecipesTest.clshas two related test-quality issues. I'd like to work on fixing them if the maintainers agree.1. Tautological assertions that always pass — the three "success" tests (
hashRecipesWhenSuccessTestL66,hmacRecipesWhenSuccessTestL107,digitalSignatureRecipesWhenSuccessTestL153) end withSystem.assert(true, 'No error was expected'), which passes unconditionally and verifies nothing.Proposal: replace with a meaningful assertion on the generated value (e.g.
System.Assert.isNotNull(hmac, ...)).2. Legacy assertion API — the file uses
System.assert()andSystem.assertEquals()while the rest of the suite uses the modernSystem.Assertclass.Proposal: migrate to
System.AssertclassScope: limited to
force-app/tests/Encryption Recipes/EncryptionRecipesTest.clsHappy to adjust the scope based on your preference.