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