LoggerImpl implements Logger { @Override public void data(String methodName) { logger.trace(LogMarker.DATA.getValue(), methodName, (Object)null); } LoggerImpl(Class<?> clazz);  LoggerImpl(org.slf4j.Logger logger); @Override void setClientId(String clientId); @Override void info(String message); @Override void warning(String message); @Override void error(String message); @Override void error(String message, Throwable throwable); @Override void entry(String methodName); @Override void entry(String methodName, Object... objects); @Override void entry(Object source, String methodName); @Override void entry(Object source, String methodName, Object... objects); @Override void exit(String methodName); @Override void exit(String methodName, Object result); @Override void exit(Object source, String methodName); @Override void exit(Object source, String methodName, Object result); @Override void data(String methodName); @Override void data(String methodName, Object... objects); @Override void data(Object source, String methodName); @Override void data(Object source, String methodName, Object... objects); @Override void throwing(String methodName, Throwable throwable); @Override void throwing(Object source, String methodName, Throwable throwable); @Override void ffdc(String methodName, FFDCProbeId probeId, Throwable throwable, Object... data); @Override void ffdc(Object source, String methodName, FFDCProbeId probeId, Throwable throwable, Object... data);  }
@Test public void testData() { final MockLogger logger = new MockLogger("testData"); final Logger testLogger = LoggerFactory.getLogger(logger); final String methodName = "testDataMethod"; testLogger.data(methodName); MockEvent event = logger.getEvent(); assertEquals("Unexpected type", "trace", event.type); assertEquals("Unexpected marker", LogMarker.DATA.getValue(), event.marker); assertEquals("Unexpected method name", methodName, event.message); assertNull("Unexpected throwable", event.throwable); assertNull("Unexpected object", event.args[0]); assertEquals("Unexpected args", 1, event.args.length); testLogger.data(this, methodName); event = logger.getEvent(); assertEquals("Unexpected type", "trace", event.type); assertEquals("Unexpected marker", LogMarker.DATA.getValue(), event.marker); assertEquals("Unexpected method name", methodName, event.message); assertNull("Unexpected throwable", event.throwable); assertEquals("Unexpected object", this, event.args[0]); assertEquals("Unexpected args", 1, event.args.length); Integer arg1 = 123; String arg2 = "abc"; testLogger.data(methodName, arg1, arg2); event = logger.getEvent(); assertEquals("Unexpected type", "trace", event.type); assertEquals("Unexpected marker", LogMarker.DATA.getValue(), event.marker); assertEquals("Unexpected method name", methodName, event.message); assertNull("Unexpected throwable", event.throwable); assertNull("Unexpected object", event.args[0]); assertEquals("Unexpected arg1", arg1, event.args[1]); assertEquals("Unexpected arg2", arg2, event.args[2]); assertEquals("Unexpected args", 3, event.args.length); arg1 = 567; arg2 = "jgf"; ProcessBuilder arg3 = new ProcessBuilder(); testLogger.data(this, methodName, arg1, arg2, arg3); event = logger.getEvent(); assertEquals("Unexpected type", "trace", event.type); assertEquals("Unexpected marker", LogMarker.DATA.getValue(), event.marker); assertEquals("Unexpected method name", methodName, event.message); assertNull("Unexpected throwable", event.throwable); assertEquals("Unexpected object", this, event.args[0]); assertEquals("Unexpected arg1", arg1, event.args[1]); assertEquals("Unexpected arg2", arg2, event.args[2]); assertEquals("Unexpected arg2", arg3, event.args[3]); assertEquals("Unexpected args", 4, event.args.length); try { event = logger.getEvent(); fail("Unexpected event: "+event); } catch(NoSuchElementException e) { } }