private NotifyMessageProducer notifyMessageProducer;
@Test
public void queueMessage() {
ThreadUtils.sleep(1000);
MockLog4jAppender appender = new MockLog4jAppender();
appender.addToLogger(NotifyMessageListener.class);
User user = new User();
user.setName("calvin");
user.setEmail("calvin@sringside.org.cn");
notifyMessageProducer.sendQueue(user);
logger.info("sended message");
ThreadUtils.sleep(1000);
assertNotNull(appender.getFirstLog());
assertEquals("UserName:calvin, Email:calvin@sringside.org.cn", appender.getFirstLog().getMessage());
}