Search in sources :

Example 1 with FeaturedModResponse

use of com.faforever.server.mod.FeaturedModResponse in project faf-java-server by FAForever.

the class ClientServiceTest method sendModList.

@Test
public void sendModList() throws Exception {
    instance.sendModList(Collections.singletonList(new FeaturedMod().setDisplayName("Mod").setTechnicalName("mod").setDisplayOrder(4).setDescription("Description")), player);
    ArgumentCaptor<FeaturedModResponse> captor = ArgumentCaptor.forClass(FeaturedModResponse.class);
    verify(clientGateway).send(captor.capture(), eq(clientConnection));
    FeaturedModResponse response = captor.getValue();
    assertThat(response.getDisplayName(), is("Mod"));
    assertThat(response.getTechnicalName(), is("mod"));
    assertThat(response.getDisplayOrder(), is(4));
    assertThat(response.getDescription(), is("Description"));
}
Also used : FeaturedMod(com.faforever.server.entity.FeaturedMod) FeaturedModResponse(com.faforever.server.mod.FeaturedModResponse) Test(org.junit.Test)

Example 2 with FeaturedModResponse

use of com.faforever.server.mod.FeaturedModResponse in project faf-java-server by FAForever.

the class FeaturedModResponseTransformerTest method transform.

@Test
public void transform() throws Exception {
    Map<String, Serializable> result = FeaturedModResponseTransformer.INSTANCE.transform(new FeaturedModResponse("test", "Test mod", "This is a test mod", 3));
    assertThat(result.get("command"), is("mod_info"));
    assertThat(result.get("publish"), is(1));
    assertThat(result.get("name"), is("test"));
    assertThat(result.get("fullname"), is("Test mod"));
    assertThat(result.get("desc"), is("This is a test mod"));
    assertThat(result.get("order"), is(3));
}
Also used : Serializable(java.io.Serializable) FeaturedModResponse(com.faforever.server.mod.FeaturedModResponse) Test(org.junit.Test)

Example 3 with FeaturedModResponse

use of com.faforever.server.mod.FeaturedModResponse in project faf-java-server by FAForever.

the class V2ServerMessageTransformerTest method featuredMod.

@Test
public void featuredMod() throws Exception {
    String response = instance.transform(new FeaturedModResponse("faf", "Forged Alliance Forever", "Description", 1));
    assertThat(response, is("{\"data\":{\"technicalName\":\"faf\",\"displayName\":\"Forged Alliance Forever\",\"description\":\"Description\",\"displayOrder\":1},\"type\":\"featuredMod\"}"));
}
Also used : FeaturedModResponse(com.faforever.server.mod.FeaturedModResponse) Test(org.junit.Test)

Aggregations

FeaturedModResponse (com.faforever.server.mod.FeaturedModResponse)3 Test (org.junit.Test)3 FeaturedMod (com.faforever.server.entity.FeaturedMod)1 Serializable (java.io.Serializable)1