use of com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage in project downlords-faf-client by FAForever.
the class FafServerAccessorImpl method startSearchLadder1v1.
@Override
public CompletableFuture<GameLaunchMessage> startSearchLadder1v1(Faction faction) {
gameLaunchFuture = new CompletableFuture<>();
writeToServer(new SearchLadder1v1ClientMessage(faction));
return gameLaunchFuture;
}
use of com.faforever.client.rankedmatch.SearchLadder1v1ClientMessage in project downlords-faf-client by FAForever.
the class ServerAccessorImplTest method startSearchLadder1v1WithAeon.
@Test
public void startSearchLadder1v1WithAeon() throws Exception {
connectAndLogIn();
CompletableFuture<GameLaunchMessage> future = instance.startSearchLadder1v1(Faction.AEON).toCompletableFuture();
String clientMessage = messagesReceivedByFafServer.poll(TIMEOUT, TIMEOUT_UNIT);
SearchLadder1v1ClientMessage searchRanked1v1Message = gson.fromJson(clientMessage, SearchLadder1v1ClientMessage.class);
assertThat(searchRanked1v1Message, instanceOf(SearchLadder1v1ClientMessage.class));
assertThat(searchRanked1v1Message.getFaction(), is(Faction.AEON));
GameLaunchMessage gameLaunchMessage = new GameLaunchMessage();
gameLaunchMessage.setUid(1234);
sendFromServer(gameLaunchMessage);
assertThat(future.get(TIMEOUT, TIMEOUT_UNIT).getUid(), is(gameLaunchMessage.getUid()));
}
Aggregations