Search in sources :

Example 6 with MatchmakerMessage

use of com.faforever.client.rankedmatch.MatchmakerMessage in project downlords-faf-client by FAForever.

the class MainControllerTest method testOnMatchMakerMessageDisplaysNotificationWithQueuesButDisabled.

@Test
public void testOnMatchMakerMessageDisplaysNotificationWithQueuesButDisabled() {
    @SuppressWarnings("unchecked") ArgumentCaptor<Consumer<MatchmakerMessage>> matchmakerMessageCaptor = ArgumentCaptor.forClass(Consumer.class);
    when(notificationPrefs.getLadder1v1ToastEnabled()).thenReturn(false);
    verify(gameService).addOnRankedMatchNotificationListener(matchmakerMessageCaptor.capture());
    MatchmakerMessage matchmakerMessage = new MatchmakerMessage();
    matchmakerMessage.setQueues(singletonList(new MatchmakerMessage.MatchmakerQueue("ladder1v1", singletonList(new RatingRange(1500, 1510)), singletonList(new RatingRange(1500, 1510)))));
    matchmakerMessageCaptor.getValue().accept(matchmakerMessage);
    verify(notificationService, never()).addNotification(any(TransientNotification.class));
}
Also used : TransientNotification(com.faforever.client.notification.TransientNotification) Consumer(java.util.function.Consumer) RatingRange(com.faforever.client.remote.domain.RatingRange) MatchmakerMessage(com.faforever.client.rankedmatch.MatchmakerMessage) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Aggregations

MatchmakerMessage (com.faforever.client.rankedmatch.MatchmakerMessage)6 RatingRange (com.faforever.client.remote.domain.RatingRange)5 Consumer (java.util.function.Consumer)4 TransientNotification (com.faforever.client.notification.TransientNotification)3 I18n (com.faforever.client.i18n.I18n)2 NotificationService (com.faforever.client.notification.NotificationService)2 PersistentNotification (com.faforever.client.notification.PersistentNotification)2 Severity (com.faforever.client.notification.Severity)2 AbstractPlainJavaFxTest (com.faforever.client.test.AbstractPlainJavaFxTest)2 LoginSuccessEvent (com.faforever.client.user.event.LoginSuccessEvent)2 EventBus (com.google.common.eventbus.EventBus)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 List (java.util.List)2 Inject (javax.inject.Inject)2 Test (org.junit.Test)2 Component (org.springframework.stereotype.Component)2 FafClientApplication (com.faforever.client.FafClientApplication)1 UnreadPrivateMessageEvent (com.faforever.client.chat.event.UnreadPrivateMessageEvent)1 ClientProperties (com.faforever.client.config.ClientProperties)1