mirror of
https://github.com/tiennm99/tjahzi.git
synced 2026-10-14 10:19:01 +00:00
Adjusting test to new reality of not interpolating messages sing 2.15.0.
This commit is contained in:
1 parent
13ae3263ea
commit
4bdbdae054
2 files changed
+7
-8
No files matched your search
+6
-7
@@ -31,17 +31,16 @@ public class Log4jAdapterLabelPrinter implements LabelPrinter {
|
||||
|
||||
@Override
|
||||
public boolean isStatic() {
|
||||
for (int i = 0; i < formatters.size(); i++) {
|
||||
for (int i = 0; i < formatters.size(); i = i + 1) {
|
||||
LogEventPatternConverter converter = formatters.get(i).getConverter();
|
||||
|
||||
if (!(converter instanceof LiteralPatternConverter)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (((LiteralPatternConverter) converter).getLiteral().contains("$")) {
|
||||
return false;
|
||||
if (converter instanceof LiteralPatternConverter) {
|
||||
if (((LiteralPatternConverter) converter).getLiteral().contains("$")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return !converter.isVariable();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ class Log4jAdapterLabelPrinterTest {
|
||||
Arguments.of("Empty", "", true),
|
||||
Arguments.of("Literal value", "literal value", true),
|
||||
Arguments.of("Literal value with variable", "Literal & variable: ${server}", false),
|
||||
Arguments.of("Contains pattern", "With pattern %c{1}", false)
|
||||
Arguments.of("Contains pattern", "With pattern %c{1}", true) // Since 2.15.0 no interpolation possible
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user