ppkarwasz commented on code in PR #3045:
URL: https://github.com/apache/logging-log4j2/pull/3045#discussion_r1793555581
##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java:
##########
@@ -64,20 +63,15 @@ public void testParametersAreNotLeaked() throws Exception {
final String line1 = reader.readLine();
final String line2 = reader.readLine();
final String line3 = reader.readLine();
- // line4 is empty line because of the line separator after throwable
pattern
final String line4 = reader.readLine();
final String line5 = reader.readLine();
- final String line6 = reader.readLine();
- final String line7 = reader.readLine();
reader.close();
- file.delete();
+ // file.delete();
assertThat(line1, containsString("Message with parameter paramValue"));
assertThat(line2, containsString("paramValue"));
assertThat(line3, containsString("paramValue"));
- assertThat(line4, is(""));
- assertThat(line5, containsString("paramValue"));
- assertThat(line6, is(""));
- assertNull(line7, "Expected only six lines");
+ assertThat(line4, containsString("paramValue"));
+ assertNull(line5, "Expected only six lines");
Review Comment:
Why do we still need some `startsWith` assertions?
https://github.com/apache/logging-log4j2/blob/2022db7d3910bcd07b006452efc12e99482ca14c/log4j-core-test/src/test/java/org/apache/logging/log4j/core/EventParameterMemoryLeakTest.java#L62-L66
These prevent us from using `containsExactly(CharSequence...)`.
If it is complicated, don't bother. This looks good enough to me.
--
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]