* Test to ensure that when an invitation is received, the resulting chat
* created has the same data properties.
*/
@Test
public void shouldPreserveInvitationProperties() {
final RoomChatChangedTestHandler chatCreatedHandler = new RoomChatChangedTestHandler(ChangeType.created);
manager.addRoomChatChangedHandler(chatCreatedHandler);
final String reason = "theReason";
final XmppURI invitor = uri("friend@host/resource");
final XmppURI roomURI = uri("room@room.service");
final ChatProperties properties = new ChatProperties(roomURI);
final String testDataKey = "TEST_KEY";
final String testDataValue = "TEST_VALUE";
properties.setData(testDataKey, testDataValue);
manager.acceptRoomInvitation(new RoomInvitation(invitor, roomURI, reason, properties));
final RoomChat room = chatCreatedHandler.getLastChat();
assertEquals("Chat property not preserved", testDataValue, room.getProperties().getData(testDataKey));
}