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