Search in sources :

Example 1 with SocialMessage

use of com.faforever.client.remote.domain.SocialMessage in project downlords-faf-client by FAForever.

the class PircBotXChatServiceTest method connect.

private void connect() throws Exception {
    instance.connect();
    verify(pircBotXFactory).createPircBotX(configurationCaptor.capture());
    CountDownLatch latch = listenForConnected();
    firePircBotXEvent(new ConnectEvent(pircBotX));
    assertTrue(latch.await(TIMEOUT, TIMEOUT_UNIT));
    UserHostmask nickServHostMask = mock(UserHostmask.class);
    when(nickServHostMask.getHostmask()).thenReturn("nickserv");
    when(configuration.getNickservNick()).thenReturn("nickserv");
    when(configuration.getNickservOnSuccess()).thenReturn("you are now");
    firePircBotXEvent(new NoticeEvent(pircBotX, nickServHostMask, null, null, "", "you are now identified"));
    SocialMessage socialMessage = new SocialMessage();
    socialMessage.setChannels(Collections.emptyList());
    socialMessageListenerCaptor.getValue().accept(socialMessage);
    verify(outputIrc, timeout(TIMEOUT).atLeastOnce()).joinChannel(DEFAULT_CHANNEL_NAME);
}
Also used : ConnectEvent(org.pircbotx.hooks.events.ConnectEvent) NoticeEvent(org.pircbotx.hooks.events.NoticeEvent) SocialMessage(com.faforever.client.remote.domain.SocialMessage) UserHostmask(org.pircbotx.UserHostmask) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

SocialMessage (com.faforever.client.remote.domain.SocialMessage)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 UserHostmask (org.pircbotx.UserHostmask)1 ConnectEvent (org.pircbotx.hooks.events.ConnectEvent)1 NoticeEvent (org.pircbotx.hooks.events.NoticeEvent)1