Search in sources :

Example 1 with AvatarChangedEvent

use of com.faforever.client.chat.avatar.event.AvatarChangedEvent in project downlords-faf-client by FAForever.

the class FafServiceImplTest method selectAvatar.

@Test
public void selectAvatar() throws Exception {
    URL url = new URL("http://example.com");
    instance.selectAvatar(new AvatarBean(url, "Description"));
    ArgumentCaptor<AvatarChangedEvent> eventCaptor = ArgumentCaptor.forClass(AvatarChangedEvent.class);
    verify(eventBus).post(eventCaptor.capture());
    AvatarBean avatar = eventCaptor.getValue().getAvatar();
    assertThat(avatar, not(nullValue()));
    assertThat(avatar.getUrl(), is(url));
    assertThat(avatar.getDescription(), is("Description"));
    verify(fafServerAccessor).selectAvatar(url);
}
Also used : AvatarBean(com.faforever.client.chat.avatar.AvatarBean) AvatarChangedEvent(com.faforever.client.chat.avatar.event.AvatarChangedEvent) URL(java.net.URL) Test(org.junit.Test)

Example 2 with AvatarChangedEvent

use of com.faforever.client.chat.avatar.event.AvatarChangedEvent in project downlords-faf-client by FAForever.

the class FafServiceImpl method selectAvatar.

@Override
public void selectAvatar(AvatarBean avatar) {
    fafServerAccessor.selectAvatar(avatar == null ? null : avatar.getUrl());
    eventBus.post(new AvatarChangedEvent(avatar));
}
Also used : AvatarChangedEvent(com.faforever.client.chat.avatar.event.AvatarChangedEvent)

Aggregations

AvatarChangedEvent (com.faforever.client.chat.avatar.event.AvatarChangedEvent)2 AvatarBean (com.faforever.client.chat.avatar.AvatarBean)1 URL (java.net.URL)1 Test (org.junit.Test)1