}
@Before
public void init(){
//register all the LogAppenders
registerLogAppender(new LogAppender("one") {
@Override
public void log(Level level, Object message) {
assertTrue(Predicates.in(ImmutableList.<String>of("from static logger", "from NON static logger")).
apply(message.toString()));
LOGGER.info("Appender named 'ONE' received: " + message + ", @ level:" + level.toString());
}
@Override
public void close() {
LOGGER.info("Release some resources. Not mandatory.");
}
});
registerLogAppender(new LogAppender("two") {
@Override
public void log(Level level, Object message) {
assertTrue(Predicates.equalTo("from injected logger").
apply(message.toString()));
LOGGER.info("Appender named 'TWO' received: " + message + ", @ level:" + level.toString());