Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server unit tests #39

Merged
merged 8 commits into from
Dec 1, 2024
Merged

Server unit tests #39

merged 8 commits into from
Dec 1, 2024

Conversation

Zargess
Copy link
Collaborator

@Zargess Zargess commented Nov 15, 2024

Testing

Ensured 100% test and pitest coverage of InputHandler and ConversationHandler

Pitest

Introduced pitest on the server to help improve the tests we write

Removed old unused jar files

I have removed the old jar files we used as dependencies to as we now use gradle and maven for dependencies

@Zargess Zargess requested a review from miniwolf November 15, 2024 19:53
@Zargess Zargess force-pushed the server-unit-tests branch 2 times, most recently from 75b6e59 to c323704 Compare November 24, 2024 21:31
* Testing request types
** GetAllConversationDataRequest
** GetConversationsRequest
** UpdateHistoryRequests
** UpdateHistoryRequests
** DeleteFriendRequests
** DeleteFriendRequests
** LogoutRequests
** UpdateHistoryRequests
** SearchUsersRequests
** UserNameAvailableRequests
* Made AddParticipantRequest tests verify users gets the conversation id
* Made some utility functions for testing
* Removed print statements
* Made sure that responses of requests are tested
* Deleted unused libraries
* Removed build.bat file
* Removed external libraries, run and build shell scripts
* Installed pitest plugin
* Improved tests with the help of pitest
Now testing that the threading parts of ConversationHandler works
Copy link
Owner

@miniwolf miniwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Småting:

  • Base Class til InputHandler
  • Spørgsmål omkring timeout i test
  • Unøddigt brug af library

* Introduced a Base InputHandler test class to handle the common setup and have useful helper functions
* Put a timeout on a TextMessageIntegrationTest such that it can be cancelled if it takes too long
* Put a todo with link to the trello task that will fix the username vulnerability
* Removed dependency only used for testing and implemented a helper function that provides the needed test functionality
Applied code style to test classes
Copy link
Owner

@miniwolf miniwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the formatting issues and then let's get it in.

Removed @mock annotation
Removed unused MockitoExtension and Mockito strictness
Removed unused MockitoExtension
Removed Captor annotation as we no longer MockitoExtension
@Zargess Zargess merged commit 2dfa43b into develop Dec 1, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants