mirror of
https://github.com/tiennm99/tjahzi.git
synced 2026-10-14 04:16:39 +00:00
Added test for default value resolution for missing ctx lookup.
This commit is contained in:
1 parent
5ff45b4eaf
commit
2e9d4adc67
2 files changed
+2
-3
No files matched your search
+1
-3
@@ -52,9 +52,6 @@ class LabelsContextSubstitutionTest {
|
||||
((org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false))
|
||||
.setConfigLocation(uri);
|
||||
|
||||
String expectedLogLine = "Test";
|
||||
long expectedTimestamp = System.currentTimeMillis();
|
||||
|
||||
Logger logger = LogManager.getLogger(LokiAppenderTest.class);
|
||||
|
||||
// When
|
||||
@@ -95,6 +92,7 @@ class LabelsContextSubstitutionTest {
|
||||
.body("data.result.stream.server", everyItem(equalTo("127.0.0.1")))
|
||||
.body("data.result.stream.object", contains("prefix_${ctx:object}", "prefix_bust_ticket", "prefix_comb"))
|
||||
.body("data.result.stream.owner", contains("${ctx:owner}_suffix", "wally_suffix", "jennifer_suffix"))
|
||||
.body("data.result.stream.default_value_test", contains("use_this_if_missing", "use_this_if_missing", "use_this_if_missing"))
|
||||
.body("data.result.values",
|
||||
hasItems(
|
||||
hasItems(hasItems(("LokiAppenderTest - Test3"))),
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<Label name="server" value="127.0.0.1"/>
|
||||
<Label name="object" value="prefix_${ctx:object}"/>
|
||||
<Label name="owner" value="${ctx:owner}_suffix"/>
|
||||
<Label name="default_value_test" value="${ctx:missing:-use_this_if_missing}"/>
|
||||
</Loki>
|
||||
</appenders>
|
||||
</configuration>
|
||||
Reference in new issue
Block a user