Search in sources :

Example 6 with MissingGamePathEvent

use of com.faforever.client.preferences.event.MissingGamePathEvent in project downlords-faf-client by FAForever.

the class Ladder1V1ControllerTest method testOnPlayButtonClickedWithNoGamePath.

@Test
public void testOnPlayButtonClickedWithNoGamePath() throws Exception {
    when(forgedAlliancePrefs.getPath()).thenReturn(null);
    instance.onPlayButtonClicked();
    verify(gameService, never()).startSearchLadder1v1(any());
    verify(eventBus).post(new MissingGamePathEvent(true));
    assertThat(instance.cancelButton.isVisible(), is(false));
    assertThat(instance.playButton.isVisible(), is(true));
    assertThat(instance.searchProgressIndicator.isVisible(), is(false));
    assertThat(instance.searchingForOpponentLabel.isVisible(), is(false));
}
Also used : MissingGamePathEvent(com.faforever.client.preferences.event.MissingGamePathEvent) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Aggregations

MissingGamePathEvent (com.faforever.client.preferences.event.MissingGamePathEvent)6 Test (org.junit.Test)3 ImmediateNotification (com.faforever.client.notification.ImmediateNotification)2 PersistentNotification (com.faforever.client.notification.PersistentNotification)2 Faction (com.faforever.client.game.Faction)1 I18n (com.faforever.client.i18n.I18n)1 Action (com.faforever.client.notification.Action)1 NotificationService (com.faforever.client.notification.NotificationService)1 Severity (com.faforever.client.notification.Severity)1 AbstractPlainJavaFxTest (com.faforever.client.test.AbstractPlainJavaFxTest)1 GameDirectoryChooseEvent (com.faforever.client.ui.preferences.event.GameDirectoryChooseEvent)1 GameDirectoryChosenEvent (com.faforever.client.ui.preferences.event.GameDirectoryChosenEvent)1 EventBus (com.google.common.eventbus.EventBus)1 Subscribe (com.google.common.eventbus.Subscribe)1 Path (java.nio.file.Path)1 Collections (java.util.Collections)1 List (java.util.List)1 PostConstruct (javax.annotation.PostConstruct)1 Inject (javax.inject.Inject)1 Component (org.springframework.stereotype.Component)1