barrynfleming commented on a change in pull request #588:
URL: https://github.com/apache/logging-log4j2/pull/588#discussion_r731252556
##########
File path:
log4j-core/src/test/java/org/apache/logging/log4j/core/net/SmtpManagerTest.java
##########
@@ -33,4 +45,41 @@ void testCreateManagerName() {
assertEquals("SMTP:to:cc::from::LOG4J2-3107:proto:smtp.log4j.com:4711:username::filter",
managerName);
}
+ private void testAdd(LogEvent event) {
+ SmtpManager smtpManager = SmtpManager.getSmtpManager(null, "to", "cc",
"bcc", "from", "replyTo", "subject", "protocol", "host", 0, "username",
"password", false, "filterName", 10, null);
+ smtpManager.removeAllBufferedEvents(); // in case this smtpManager is
reused
Review comment:
@vy I added `removeAllBufferedEvents()` so I could assert that the
messages that got buffered are immutable. I don't mind creating fresh manager
instances as you say, but I'm not sure how to make the assertion without access
to the buffered events. Any thoughts?
I will update `changes.xml`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]