Closed shourav9884 closed 4 years ago
@marcinadd thank you so much for reviewing. I have updated code according to your comment.
Ok. Thanks. Now it looks much better in my opinion. You added integration tests to MessageController, but you can also add Unit tests which test only MessageValidator. See UserValidatorTests class for example. Don't forget to fix possible NullPointerException which I reviewed above.
Ok. I will update my tests. About the NullpointerException
case as I replied your comment above, I think it will not happen because it is checked already
Yes, you're right. As a curiosity, I will give an example that in your code (and in my WIP code too) there is a chance that MessageValidator can allow you to send a message to yourself :)
@marcinadd added some test case and fixed the equal checking for user by overriding the equals
method. please check
Your code will be merged tomorrow. Thanks
You have created a lot of commits. To keep my branch clean I squash merged it. Your commit messages are in the description. Thanks for your contribution
Thanks for your contribution :) You don't have to create your own annotations. This project uses spring so your MessageValidator should implement org.springframework.validation.Validator. Then you use (@)Valid annotation. Check how UserValidator works and make MessageSimilar similar to it. You should also provide some tests for your code.