Repository navigation
Add Unit and Integration Tests #2
Description
Activity
- addedenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
on Oct 5, 2025 Hi @thughari
I forked the repository and cloned my fork, and I went through the java codes, I didn't find any service or repos, but I found some endpoints in the controllers, do those endpoints need testing?
Also about the services and repos, are they available, so I can start writing tests for them
Thanks for checking the code!
You're right, the project doesn't have any service or repository layer since it doesn't persist data.For now, the main focus can be on writing tests for the existing controller and handler endpoints, as well as testing the WebSocket configuration.
Hi @thughari ,
I’d like to work on adding unit and integration tests to improve the code quality and robustness of RandomChat.
Since the project doesn’t currently have a service or repository layer, my focus will be on testing the existing controller and WebSocket handler endpoints. I’ll use JUnit 5 and Mockito (along with Spring Boot’s testing support) to write:
Unit tests for controller and WebSocket message handling logic.
Integration tests using MockMvc or WebSocket test clients to ensure the endpoints and configurations behave correctly in the Spring context.
These tests will help validate message routing, connection handling, and overall stability of the real-time chat flow.
If this approach looks good, I’ll start implementing the tests under
src/test/java/com/thughari/randomchat/ and open a PR once it’s ready.That sounds like an excellent plan! I appreciate your initiative to improve the code quality and coverage with unit and integration tests.
Please go ahead and start implementing the tests. When you’re done, make sure to open your PR to the
devbranch for review.Looking forward to your PR!
Thanks for contributing to RandomChat 🙌
hey @thughari thanks for the follow up and I just want to tell you that i would raise few separate PR and not at once as the solution is vast and requires proper effort on each part
I hope you understand this thanks!!Thanks @AnshulBytes112 Sounds good!please proceed 👍
What to do
com.thughari.randomchat.Goal
Improve code quality and make RandomChat more robust.