Search in sources :

Example 1 with PlayerEvent

use of com.faforever.client.api.dto.PlayerEvent in project downlords-faf-client by FAForever.

the class FafApiAccessorImplTest method testGetPlayerEvents.

@Test
@SuppressWarnings("unchecked")
public void testGetPlayerEvents() {
    PlayerEvent playerEvent1 = new PlayerEvent();
    playerEvent1.setId("1");
    playerEvent1.setEvent(new Event().setId("1-1-1"));
    playerEvent1.setCurrentCount(11);
    PlayerEvent playerEvent2 = new PlayerEvent();
    playerEvent2.setId("2");
    playerEvent2.setEvent(new Event().setId("2-2-2"));
    playerEvent2.setCurrentCount(22);
    List<PlayerEvent> result = Arrays.asList(playerEvent1, playerEvent2);
    when(restOperations.getForObject(anyString(), eq(List.class))).thenReturn(result).thenReturn(emptyList());
    assertThat(instance.getPlayerEvents(123), is(result));
    verify(restOperations).getForObject("/data/playerEvent" + "?filter=player.id==\"123\"" + "&page[size]=10000" + "&page[number]=1", List.class);
}
Also used : PlayerEvent(com.faforever.client.api.dto.PlayerEvent) PlayerEvent(com.faforever.client.api.dto.PlayerEvent) Event(com.faforever.client.api.dto.Event) Test(org.junit.Test)

Aggregations

Event (com.faforever.client.api.dto.Event)1 PlayerEvent (com.faforever.client.api.dto.PlayerEvent)1 Test (org.junit.Test)1