Search in sources :

Example 21 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method login.

@Test
public void login() throws Exception {
    ClientMessage result = instance.transform(write(new LoginClientMessage("jwt", "123")));
    assertThat(result, is(new LoginRequest("123", "jwt")));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) LoginRequest(com.faforever.server.client.LoginRequest) Test(org.junit.Test)

Example 22 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method disconnectPeer.

@Test
public void disconnectPeer() throws Exception {
    ClientMessage result = instance.transform(write(new DisconnectPeerClientMessage(42)));
    assertThat(result, is(new DisconnectPeerRequest(42)));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) DisconnectPeerRequest(com.faforever.server.game.DisconnectPeerRequest) Test(org.junit.Test)

Example 23 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method iceClient.

@Test
public void iceClient() throws Exception {
    ClientMessage result = instance.transform(write(new IceClientMessage(12, "foobar")));
    assertThat(result, is(new IceMessage(12, "foobar")));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) IceMessage(com.faforever.server.ice.IceMessage) Test(org.junit.Test)

Example 24 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method cancelMatchSearch.

@Test
public void cancelMatchSearch() throws Exception {
    ClientMessage result = instance.transform(write(new CancelMatchSearchClientMessage("ladder1v1")));
    assertThat(result, is(new MatchMakerCancelRequest("ladder1v1")));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) MatchMakerCancelRequest(com.faforever.server.matchmaker.MatchMakerCancelRequest) Test(org.junit.Test)

Example 25 with ClientMessage

use of com.faforever.server.common.ClientMessage in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method agreeDraw.

@Test
public void agreeDraw() throws Exception {
    ClientMessage result = instance.transform(write(new AgreeDrawClientMessage()));
    assertThat(result, is(MutuallyAgreedDrawRequest.INSTANCE));
}
Also used : ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Aggregations

ClientMessage (com.faforever.server.common.ClientMessage)27 Test (org.junit.Test)26 SelectAvatarRequest (com.faforever.server.avatar.SelectAvatarRequest)1 BroadcastRequest (com.faforever.server.client.BroadcastRequest)1 LoginRequest (com.faforever.server.client.LoginRequest)1 CoopMissionCompletedReport (com.faforever.server.coop.CoopMissionCompletedReport)1 RequestException (com.faforever.server.error.RequestException)1 AiOptionReport (com.faforever.server.game.AiOptionReport)1 ArmyScoreReport (com.faforever.server.game.ArmyScoreReport)1 DisconnectPeerRequest (com.faforever.server.game.DisconnectPeerRequest)1 GameChatMessageReport (com.faforever.server.game.GameChatMessageReport)1 GameModsReport (com.faforever.server.game.GameModsReport)1 GameOptionReport (com.faforever.server.game.GameOptionReport)1 GameStateReport (com.faforever.server.game.GameStateReport)1 HostGameRequest (com.faforever.server.game.HostGameRequest)1 JoinGameRequest (com.faforever.server.game.JoinGameRequest)1 PlayerOptionReport (com.faforever.server.game.PlayerOptionReport)1 TeamKillReport (com.faforever.server.game.TeamKillReport)1 IceMessage (com.faforever.server.ice.IceMessage)1 RestoreGameSessionRequest (com.faforever.server.integration.legacy.transformer.RestoreGameSessionRequest)1