[FEATURE] AuditMessage validation in tests should be more useful / removed #2188
Labels
enhancement
New feature or request
good first issue
These are recommended starting points for newcomers looking to make their first contributions.
triaged
Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Is your feature request related to a problem?
Test code was written to verify the format of audit log messages. This code is clunky as in tests it's written as
Assert.assertTrue(validateMsgs(messages));
. It would be far more useful if it emitted errors about why the message(s) are invalid rather than asserting false.Furthermore; It is not clear that the message format level validation in the integration tests is useful, so we should investigate under what conditions we are testing for/against.
Code in question
security/src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Line 88 in b836040
What solution would you like?
We should have assertions that clearly indicate what is wrong so the failure message can be instructive to developers diagnosing the tests, or we should remove this functionality if it isn't providing valid to our test cases.
The text was updated successfully, but these errors were encountered: