startServer(new WebSocketServerHandler());
WebSocketClientFactory clientFactory = new WebSocketClientFactory();
final TestClient callback = new TestClient();
WebSocketClient client = clientFactory.newClient(new URI("ws://localhost:" + port + "/websocket"), callback);
client.connect().awaitUninterruptibly();
Thread.sleep(1000);
assertTrue(callback.connected);
assertEquals(TestClient.TEST_MESSAGE.toUpperCase(), callback.messageReceived);
client.disconnect();
Thread.sleep(1000);
assertFalse(callback.connected);
}