Search in sources :

Example 1 with DisconnectPlayerFromGameResponse

use of com.faforever.server.client.DisconnectPlayerFromGameResponse in project faf-java-server by FAForever.

the class V2ServerMessageTransformerTest method disconnectFromPlayer.

@Test
public void disconnectFromPlayer() throws Exception {
    String response = instance.transform(new DisconnectPlayerFromGameResponse(123));
    assertThat(response, is("{\"data\":{\"playerId\":123},\"type\":\"disconnectFromPeer\"}"));
}
Also used : DisconnectPlayerFromGameResponse(com.faforever.server.client.DisconnectPlayerFromGameResponse) Test(org.junit.Test)

Example 2 with DisconnectPlayerFromGameResponse

use of com.faforever.server.client.DisconnectPlayerFromGameResponse in project faf-java-server by FAForever.

the class DisconnectPeerResponseTransformerTest method transform.

@Test
public void transform() throws Exception {
    Map<String, Serializable> response = DisconnectPeerResponseTransformer.INSTANCE.transform(new DisconnectPlayerFromGameResponse(51));
    assertThat(response.get("command"), is("DisconnectPeer"));
    assertThat(response.get("peer_id"), is(51));
    assertThat(response.get("target"), is("game"));
}
Also used : DisconnectPlayerFromGameResponse(com.faforever.server.client.DisconnectPlayerFromGameResponse) Serializable(java.io.Serializable) Test(org.junit.Test)

Aggregations

DisconnectPlayerFromGameResponse (com.faforever.server.client.DisconnectPlayerFromGameResponse)2 Test (org.junit.Test)2 Serializable (java.io.Serializable)1