Added testLookupDefaultMapIsCheckedBeforeMapMessage()
@@ -98,6 +98,20 @@ public class MapLookupTest {
assertEquals("11", lookup.lookup(event, "A1"));
}
+ @Test
+ public void testLookupDefaultMapIsCheckedBeforeMapMessage() {
+ final HashMap<String, String> map = new HashMap<>();
+ map.put("A", "ADefault");
+ final HashMap<String, Object> eventMap = new HashMap<>();
+ eventMap.put("A", "AEvent");
+ final MapMessage message = new MapMessage<>(eventMap);
+ final LogEvent event = Log4jLogEvent.newBuilder()
+ .setMessage(message)
+ .build();
+ final MapLookup lookup = new MapLookup(map);
+ assertEquals("ADefault", lookup.lookup(event, "A"));
+ }
+
@Test
public void testNullEvent() {
final HashMap<String, String> map = new HashMap<>();
