use of com.faforever.server.social.SocialRelationListResponse in project faf-java-server by FAForever.
the class SocialRelationResponseListResponseTransformerTest method transform.
@Test
public void transform() throws Exception {
Map<String, Serializable> result = SocialRelationListResponseTransformer.INSTANCE.transform(new SocialRelationListResponse(Arrays.asList(new SocialRelationResponse(1, RelationType.FRIEND), new SocialRelationResponse(2, RelationType.FOE), new SocialRelationResponse(3, RelationType.FOE), new SocialRelationResponse(4, RelationType.FRIEND))));
assertThat(result, is(ImmutableMap.of("command", "social", "friends", Arrays.asList(1, 4), "foes", Arrays.asList(2, 3))));
}
use of com.faforever.server.social.SocialRelationListResponse in project faf-java-server by FAForever.
the class V2ServerMessageTransformerTest method socialRelationList.
@Test
public void socialRelationList() throws Exception {
String response = instance.transform(new SocialRelationListResponse(Arrays.asList(new SocialRelationResponse(1, RelationType.FRIEND), new SocialRelationResponse(2, RelationType.FOE))));
assertThat(response, is("{\"data\":{\"socialRelations\":[{\"playerId\":1,\"type\":\"FRIEND\"},{\"playerId\":2,\"type\":\"FOE\"}]},\"type\":\"socialRelations\"}"));
}
use of com.faforever.server.social.SocialRelationListResponse in project faf-java-server by FAForever.
the class ClientServiceTest method sendSocialRelations.
@Test
public void sendSocialRelations() throws Exception {
SocialRelationListResponse response = new SocialRelationListResponse(emptyList());
instance.sendSocialRelations(response, clientConnection);
verify(clientGateway).send(response, clientConnection);
}
Aggregations