From the course: WebSocket Programming with Java EE
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
How to test WebSocket endpoints
From the course: WebSocket Programming with Java EE
How to test WebSocket endpoints
- [Voiceover] Testing the code that you develop is an important and diverse topic that really deserves its own course, however, I think that it is worth taking a bird's eye view of the tools available in the developer's toolbox. Testing can be done at the unit level with or without a framework and integration testing can be done in-house or remote by a third party. So, there are many options available to the developer to properly test their WebSocket implementations. Let's start by looking at two ways to test a WebSocket, using code. You can create a server and a client using the ClientManager and server classes from the Tyrus project, which we saw earlier on in the course. You would do this in order to create interactions with the server to test how the WebSocket endpoints respond. And you will create a client and use a server instance to test its response. The advantage here is that you are not mocking any objects. You're using the real code, although you must have in mind that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.