LogbackUtil { public static void addMarker(Marker marker, Map<String, String> mdcMap, LogDataBuilder builder) { if (marker != null) { builder.withMarked(true); builder.withMarkerColors(MarkerColors.Aqua); HashMap<String, String> mdc = new HashMap<>(mdcMap); mdc.put("marker", marker.toString()); builder.withProperties(mdc); } }  static LogDataBuilder translate(ILoggingEvent ev); static void addCallerData(ILoggingEvent ev, LogDataBuilder builder); static void addException(IThrowableProxy throwableProxy, String message, LogDataBuilder builder); static void addMarker(Marker marker, Map<String, String> mdcMap, LogDataBuilder builder); static Level convertLevel(ch.qos.logback.classic.Level level);  }
@Test public void testAddNullMarker() throws Exception { LogbackUtil.addMarker(null, new HashMap<>(), builder); assertEquals(builder.build().getMarkerColors(), null); assertFalse(builder.build().isMarked()); }
@Test public void testAddMarker() throws Exception { final Marker marker = new BasicMarkerFactory().getMarker("some marker"); LogbackUtil.addMarker(marker, new HashMap<>(), builder); assertEquals(builder.build().getMarkerColors(), MarkerColors.Aqua); assertTrue(builder.build().isMarked()); assertEquals(builder.build().getProperties().get("marker"), "some marker"); }