Search in sources :

Example 1 with NoticeMessage

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

the class ServerAccessorImplTest method testOnNotice.

@Test
public void testOnNotice() throws Exception {
    connectAndLogIn();
    NoticeMessage noticeMessage = new NoticeMessage();
    noticeMessage.setText("foo bar");
    noticeMessage.setStyle("warning");
    when(i18n.get("messageFromServer")).thenReturn("Message from Server");
    sendFromServer(noticeMessage);
    ArgumentCaptor<ImmediateNotification> captor = ArgumentCaptor.forClass(ImmediateNotification.class);
    verify(notificationService, timeout(1000)).addNotification(captor.capture());
    ImmediateNotification notification = captor.getValue();
    assertThat(notification.getSeverity(), is(Severity.WARN));
    assertThat(notification.getText(), is("foo bar"));
    assertThat(notification.getTitle(), is("Message from Server"));
    verify(i18n).get("messageFromServer");
}
Also used : ImmediateNotification(com.faforever.client.notification.ImmediateNotification) NoticeMessage(com.faforever.client.remote.domain.NoticeMessage) Test(org.junit.Test) AbstractPlainJavaFxTest(com.faforever.client.test.AbstractPlainJavaFxTest)

Aggregations

ImmediateNotification (com.faforever.client.notification.ImmediateNotification)1 NoticeMessage (com.faforever.client.remote.domain.NoticeMessage)1 AbstractPlainJavaFxTest (com.faforever.client.test.AbstractPlainJavaFxTest)1 Test (org.junit.Test)1