MessageUtil { public static void setMessageAccessor(MessageAccessor messageAccessor) { if (messageAccessor == null) { if (LOGGER.isWarnEnabled()) { LOGGER.warn(LogId.WAL025008, getThreadMessage()); } return; } ThreadGroup tg = getThreadGroup(); if (tg != null) { tgm.put(tg, messageAccessor); if (LOGGER.isTraceEnabled()) { LOGGER.trace(LogId.TAL025007, getThreadMessage()); } } } protected  MessageUtil(); static String getMessage(String code); static String getMessage(String code, Object[] args); static void setMessageAccessor(MessageAccessor messageAccessor); static void removeMessageAccessor();  }
@Test public void testSetMessageAccessor01() throws Exception { MessageUtil.setMessageAccessor(null); assertThat(logger.getLoggingEvents(), is(asList( warn("[WAL025008] MessageAccessor setting is not specified. it will be skipped. tg:[main] t:[main]")))); assertTrue(true); }