Search in sources :

Example 1 with AiOptionReport

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

the class V2ClientMessageTransformerTest method aiOption.

@Test
public void aiOption() throws Exception {
    ClientMessage result = instance.transform(write(new AiOptionClientMessage("junit", "team", "1")));
    assertThat(result, is(new AiOptionReport("junit", "team", "1")));
}
Also used : AiOptionReport(com.faforever.server.game.AiOptionReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 2 with AiOptionReport

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

the class GameServiceActivatorsTest method updateAiOption.

@Test
public void updateAiOption() throws Exception {
    instance.updateAiOption(new AiOptionReport("ai", "key", "value"), clientConnection.getAuthentication());
    verify(gameService).updateAiOption(player, "ai", "key", "value");
}
Also used : AiOptionReport(com.faforever.server.game.AiOptionReport) Test(org.junit.Test)

Example 3 with AiOptionReport

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

the class LegacyRequestTransformerTest method transformAiOption.

@Test
public void transformAiOption() throws Exception {
    AiOptionReport aiOptionReport = (AiOptionReport) instance.transform(ImmutableMap.of(KEY_COMMAND, "AIOption", KEY_ARGS, Arrays.asList("QAI", "Faction", 3)));
    assertThat(aiOptionReport, is(notNullValue()));
    assertThat(aiOptionReport.getAiName(), is("QAI"));
    assertThat(aiOptionReport.getKey(), is("Faction"));
    assertThat(aiOptionReport.getValue(), is(3));
}
Also used : AiOptionReport(com.faforever.server.game.AiOptionReport) Test(org.junit.Test)

Example 4 with AiOptionReport

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

the class LegacyRequestTransformerTest method aiOption.

@Test
public void aiOption() throws Exception {
    AiOptionReport report = (AiOptionReport) instance.transform(ImmutableMap.of(KEY_COMMAND, "AIOption", KEY_ARGS, Arrays.asList("QAI", "Team", 1)));
    assertThat(report.getAiName(), is("QAI"));
    assertThat(report.getKey(), is("Team"));
    assertThat(report.getValue(), is(1));
}
Also used : AiOptionReport(com.faforever.server.game.AiOptionReport) Test(org.junit.Test)

Aggregations

AiOptionReport (com.faforever.server.game.AiOptionReport)4 Test (org.junit.Test)4 ClientMessage (com.faforever.server.common.ClientMessage)1