Search in sources :

Example 6 with RatingRange

use of com.faforever.client.remote.domain.RatingRange 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

RatingRange (com.faforever.client.remote.domain.RatingRange)6 MatchmakerMessage (com.faforever.client.rankedmatch.MatchmakerMessage)5 I18n (com.faforever.client.i18n.I18n)3 List (java.util.List)3 Consumer (java.util.function.Consumer)3 Inject (javax.inject.Inject)3 Component (org.springframework.stereotype.Component)3 Controller (com.faforever.client.fx.Controller)2 NotificationService (com.faforever.client.notification.NotificationService)2 PersistentNotification (com.faforever.client.notification.PersistentNotification)2 Severity (com.faforever.client.notification.Severity)2 TransientNotification (com.faforever.client.notification.TransientNotification)2 PreferencesService (com.faforever.client.preferences.PreferencesService)2 UiService (com.faforever.client.theme.UiService)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 HashMap (java.util.HashMap)2 Platform (javafx.application.Platform)2