use of com.faforever.server.client.ClientConnection in project faf-java-server by FAForever.
the class GameServiceActivatorsTest method setUp.
@Before
public void setUp() throws Exception {
clientConnection = new ClientConnection("1", Protocol.V1_LEGACY_UTF_16, mock(InetAddress.class));
player = new Player();
User user = (User) new User().setPlayer(player).setPassword("password").setLogin("JUnit");
clientConnection.setAuthentication(new TestingAuthenticationToken(new FafUserDetails(user), null));
instance = new GameServiceActivators(gameService);
}
use of com.faforever.server.client.ClientConnection in project faf-java-server by FAForever.
the class ClientConnectionChannelInterceptor method preSend.
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
org.springframework.messaging.MessageHeaders messageHeaders = message.getHeaders();
String connectionId = (String) messageHeaders.get(CORRELATION_ID);
ClientConnection clientConnection = clientConnectionService.getClientConnection(connectionId).orElseThrow(() -> new IllegalStateException("There is no connection with ID: " + connectionId));
SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.wrap(message);
accessor.setUser(clientConnection.getAuthentication());
return MessageBuilder.fromMessage(message).setHeader(CLIENT_CONNECTION, clientConnection).copyHeaders(accessor.getMessageHeaders()).build();
}
use of com.faforever.server.client.ClientConnection in project faf-java-server by FAForever.
the class LegacyAdapterConfigTest method onCloseConnection.
@Test
public void onCloseConnection() throws Exception {
ClientConnection clientConnection = new ClientConnection("1", Protocol.V1_LEGACY_UTF_16, mock(InetAddress.class));
instance.onCloseConnection(new CloseConnectionEvent(this, clientConnection));
// Not much to assert here
}
use of com.faforever.server.client.ClientConnection in project faf-java-server by FAForever.
the class IceServiceActivatorsTest method setUp.
@Before
public void setUp() throws Exception {
player = new Player();
player.setClientConnection(clientConnection);
clientConnection = new ClientConnection("1", Protocol.V1_LEGACY_UTF_16, mock(InetAddress.class)).setAuthentication(new TestingAuthenticationToken(new FafUserDetails((User) new User().setPlayer(player).setPassword("pw").setLogin("JUnit")), null));
instance = new IceServiceActivators(iceService);
}
Aggregations