Added message listener and junit test.