-
Notifications
You must be signed in to change notification settings - Fork 358
[FEATURE] AuditMessage validation in tests should be more useful / removed #2188
Description
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
| protected boolean validateMsgs(final Collection<AuditMessage> msgs) { |
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.