Search in sources :

Example 1 with HostGameResponse

use of com.faforever.server.game.HostGameResponse in project faf-java-server by FAForever.

the class V2ServerMessageTransformerTest method hostGame.

@Test
public void hostGame() throws Exception {
    String response = instance.transform(new HostGameResponse("scmp01"));
    assertThat(response, is("{\"data\":{\"mapName\":\"scmp01\"},\"type\":\"hostGame\"}"));
}
Also used : HostGameResponse(com.faforever.server.game.HostGameResponse) Test(org.junit.Test)

Example 2 with HostGameResponse

use of com.faforever.server.game.HostGameResponse in project faf-java-server by FAForever.

the class ClientServiceTest method hostGame.

@Test
public void hostGame() throws Exception {
    Game game = new Game().setId(1).setMapName("SCMP_001");
    instance.hostGame(game, player);
    ArgumentCaptor<HostGameResponse> captor = ArgumentCaptor.forClass(HostGameResponse.class);
    verify(clientGateway).send(captor.capture(), any());
    assertThat(captor.getValue().getMapFilename(), is("SCMP_001"));
}
Also used : Game(com.faforever.server.entity.Game) HostGameResponse(com.faforever.server.game.HostGameResponse) Test(org.junit.Test)

Example 3 with HostGameResponse

use of com.faforever.server.game.HostGameResponse in project faf-java-server by FAForever.

the class HostGameResponseTransformerTest method transform.

@Test
public void transform() throws Exception {
    HostGameResponse response = new HostGameResponse("SCMP_001");
    Map<String, Serializable> result = HostGameResponseTransformer.INSTANCE.transform(response);
    assertThat(result.get("command"), is("HostGame"));
    assertThat(result.get("target"), is("game"));
    assertThat(result.get("args"), is(new String[] { "SCMP_001" }));
}
Also used : Serializable(java.io.Serializable) HostGameResponse(com.faforever.server.game.HostGameResponse) Test(org.junit.Test)

Aggregations

HostGameResponse (com.faforever.server.game.HostGameResponse)3 Test (org.junit.Test)3 Game (com.faforever.server.entity.Game)1 Serializable (java.io.Serializable)1