Search in sources :

Example 1 with BroadcastRequest

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

the class V2ClientMessageTransformerTest method broadcast.

@Test
public void broadcast() throws Exception {
    ClientMessage result = instance.transform(write(new BroadcastClientMessage("Hello JUnit")));
    assertThat(result, is(new BroadcastRequest("Hello JUnit")));
}
Also used : BroadcastRequest(com.faforever.server.client.BroadcastRequest) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 2 with BroadcastRequest

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

the class LegacyRequestTransformerTest method broadcastRequest.

@Test
public void broadcastRequest() throws Exception {
    BroadcastRequest request = (BroadcastRequest) instance.transform(ImmutableMap.of(KEY_COMMAND, COMMAND_ADMIN, KEY_ACTION, "broadcast", "message", "Hello world"));
    assertThat(request.getMessage(), is("Hello world"));
}
Also used : BroadcastRequest(com.faforever.server.client.BroadcastRequest) Test(org.junit.Test)

Aggregations

BroadcastRequest (com.faforever.server.client.BroadcastRequest)2 Test (org.junit.Test)2 ClientMessage (com.faforever.server.common.ClientMessage)1