Search in sources :

Example 1 with CoopMissionCompletedReport

use of com.faforever.server.coop.CoopMissionCompletedReport in project faf-java-server by FAForever.

the class V2ClientMessageTransformerTest method coopMissionCompleted.

@Test
public void coopMissionCompleted() throws Exception {
    ClientMessage result = instance.transform(write(new CoopMissionCompletedClientMessage(true, false, 300)));
    assertThat(result, is(new CoopMissionCompletedReport(true, false, Duration.ofSeconds(300))));
}
Also used : CoopMissionCompletedReport(com.faforever.server.coop.CoopMissionCompletedReport) ClientMessage(com.faforever.server.common.ClientMessage) Test(org.junit.Test)

Example 2 with CoopMissionCompletedReport

use of com.faforever.server.coop.CoopMissionCompletedReport in project faf-java-server by FAForever.

the class LegacyRequestTransformerTest method transformOperationComplete.

@Test
public void transformOperationComplete() throws Exception {
    CoopMissionCompletedReport coopMissionCompletedReport = (CoopMissionCompletedReport) instance.transform(ImmutableMap.of(KEY_COMMAND, "OperationComplete", KEY_ARGS, Arrays.asList(1, 0, 1440)));
    assertThat(coopMissionCompletedReport, is(notNullValue()));
    assertThat(coopMissionCompletedReport.isPrimaryTargets(), is(true));
    assertThat(coopMissionCompletedReport.isSecondaryTargets(), is(false));
    assertThat(coopMissionCompletedReport.getTime(), is(Duration.ofSeconds(1440)));
}
Also used : CoopMissionCompletedReport(com.faforever.server.coop.CoopMissionCompletedReport) Test(org.junit.Test)

Aggregations

CoopMissionCompletedReport (com.faforever.server.coop.CoopMissionCompletedReport)2 Test (org.junit.Test)2 ClientMessage (com.faforever.server.common.ClientMessage)1