Search in sources :

Example 1 with FeaturedModFileVersion

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

the class V2ServerMessageTransformerTest method game.

@Test
public void game() throws Exception {
    Instant startTime = Instant.parse("2007-12-03T10:15:30.00Z");
    String response = instance.transform(new GameResponse(1, "Title", GameVisibility.PUBLIC, "password", GameState.ENDED, "faf", Arrays.asList(new SimMod("1-1-1-1", "Mod #1"), new SimMod("2-2-2-2", "Mod #2")), "scmp01", "JUnit4", Arrays.asList(new Player(1, "JUnit4"), new Player(2, "JUnit5")), 12, startTime, 500, 800, Arrays.asList(new FeaturedModFileVersion((short) 1, 4444), new FeaturedModFileVersion((short) 2, 6789))));
    assertThat(response, is("{\"data\":{\"id\":1,\"title\":\"Title\",\"gameVisibility\":\"PUBLIC\",\"password\":\"password\",\"state\":\"ENDED\",\"featuredModTechnicalName\":\"faf\",\"simMods\":[{\"uid\":\"1-1-1-1\",\"displayName\":\"Mod #1\"},{\"uid\":\"2-2-2-2\",\"displayName\":\"Mod #2\"}],\"technicalMapName\":\"scmp01\",\"hostUsername\":\"JUnit4\",\"players\":[{\"team\":1,\"name\":\"JUnit4\"},{\"team\":2,\"name\":\"JUnit5\"}],\"maxPlayers\":12,\"startTime\":1196676930000,\"minRating\":500,\"maxRating\":800,\"featuredModFileVersions\":[{\"id\":1,\"version\":4444},{\"id\":2,\"version\":6789}]},\"type\":\"game\"}"));
}
Also used : GameResponse(com.faforever.server.game.GameResponse) DisconnectPlayerFromGameResponse(com.faforever.server.client.DisconnectPlayerFromGameResponse) HostGameResponse(com.faforever.server.game.HostGameResponse) FeaturedModFileVersion(com.faforever.server.game.GameResponse.FeaturedModFileVersion) Player(com.faforever.server.game.GameResponse.Player) Instant(java.time.Instant) SimMod(com.faforever.server.game.GameResponse.SimMod) Test(org.junit.Test)

Aggregations

DisconnectPlayerFromGameResponse (com.faforever.server.client.DisconnectPlayerFromGameResponse)1 GameResponse (com.faforever.server.game.GameResponse)1 FeaturedModFileVersion (com.faforever.server.game.GameResponse.FeaturedModFileVersion)1 Player (com.faforever.server.game.GameResponse.Player)1 SimMod (com.faforever.server.game.GameResponse.SimMod)1 HostGameResponse (com.faforever.server.game.HostGameResponse)1 Instant (java.time.Instant)1 Test (org.junit.Test)1