assertEquals(message, handler.getLastMessage());
}
@Test
public void shouldFireListenersWhenSubjectChange() {
final RoomSubjectChangedTestHandler handler = new RoomSubjectChangedTestHandler();
room.addRoomSubjectChangedHandler(handler);
final XmppURI occupantURI = uri("someone@domain/res");
final Message subject = new Message(null, uri("room@domain"), occupantURI);
subject.setSubject("the subject");
eventBus.fireEvent(new MessageReceivedEvent(subject));
assertEquals(1, handler.getCalledTimes());
assertEquals(occupantURI, handler.getLastEvent().getOccupantUri());
assertEquals("the subject", handler.getLastEvent().getSubject());
}