Refactorings in tests.
Fix testWebSocketServerAndEventBus test.