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");
}
Aggregations