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"));
}
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));
}
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\"}"));
}
Aggregations