@Test(expected = RoomJoinNotAllowedException.class)
public void joinRoom_firstTime_isNotOpen_noMemberAdded() {

	KixmppServer server = (KixmppServer)Mockito.when(Mockito.mock(KixmppServer.class).getEventEngine())
			.thenReturn(new KixmppEventEngine()).getMock();
	MucService mucService = (MucService)Mockito.when(Mockito.mock(MucService.class).getServer())
			.thenReturn(server).getMock();
	
    KixmppJid roomJid = new KixmppJid("testnode", "testdomain");
    MucRoom mucRoom = new MucRoom(mucService, roomJid, new MucRoomSettings(false, false, null));
    Channel channel = Mockito.mock(Channel.class);
    Attribute<KixmppJid> jidAttribute = Mockito.mock(Attribute.class);
    Mockito.when(jidAttribute.get()).thenReturn(new KixmppJid("test.user", "testdomain", "testresource"));
    Mockito.when(channel.attr(BindKixmppServerModule.JID)).thenReturn(jidAttribute);
    Mockito.when(channel.closeFuture()).thenReturn(Mockito.mock(ChannelFuture.class));
    mucRoom.join(channel, "nickname");
}