Surefire Report

Summary

[Summary] [Package List] [Test Cases]


Tests Errors Failures Skipped Success Rate Time
201 0 0 0 100% 16.83 s

Note: failures are anticipated and checked for with assertions while errors are unanticipated.


Package List

[Summary] [Package List] [Test Cases]


Package Tests Errors Failures Skipped Success Rate Time
org.sellhelp.backend.repositories 59 0 0 0 100% 4.916 s
org.sellhelp.backend.services 88 0 0 0 100% 2.333 s
org.sellhelp.backend.controllers 54 0 0 0 100% 9.580 s

Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.

org.sellhelp.backend.repositories

- Class Tests Errors Failures Skipped Success Rate Time
ChatRepositoryTest 3 0 0 0 100% 0.061 s
NotificationRepositoryTest 4 0 0 0 100% 0.045 s
CityRepositoryTest 4 0 0 0 100% 0.063 s
RoleRepositoryTest 4 0 0 0 100% 3.298 s
JobApplicationRepositoryTest 7 0 0 0 100% 0.167 s
ChatMessageRepositoryTest 4 0 0 0 100% 0.077 s
CommentRepositoryTest 4 0 0 0 100% 0.089 s
UserFileRepositoryTest 4 0 0 0 100% 0.052 s
PostRepositoryTest 6 0 0 0 100% 0.176 s
UserRepositoryTest 4 0 0 0 100% 0.066 s
ReportTypeRepositoryTest 4 0 0 0 100% 0.060 s
ReportRepositoryTest 3 0 0 0 100% 0.116 s
PostStatusRepositoryTest 4 0 0 0 100% 0.068 s
ReviewRepositoryTest 4 0 0 0 100% 0.578 s

org.sellhelp.backend.services

- Class Tests Errors Failures Skipped Success Rate Time
EmailServiceTest 4 0 0 0 100% 0.406 s
SuperUserServiceTest 10 0 0 0 100% 0.044 s
JwtUtilTest 6 0 0 0 100% 0.064 s
MfaServiceTest 10 0 0 0 100% 0.224 s
UserFileServiceTest 14 0 0 0 100% 0.249 s
TempTokenServiceTest 4 0 0 0 100% 0.012 s
UserServiceTest 6 0 0 0 100% 0.498 s
AuthServiceTest 11 0 0 0 100% 0.212 s
PostServiceTest 10 0 0 0 100% 0.312 s
PostFileServiceTest 13 0 0 0 100% 0.312 s

org.sellhelp.backend.controllers

- Class Tests Errors Failures Skipped Success Rate Time
SuperUserControllerTest 7 0 0 0 100% 1.070 s
UserFilesControllerTest 10 0 0 0 100% 1.117 s
AuthControllerTest 11 0 0 0 100% 0.985 s
UserControllerTest 6 0 0 0 100% 5.029 s
PostControllerTest 16 0 0 0 100% 0.834 s
PostFileControllerTest 4 0 0 0 100% 0.545 s

Test Cases

[Summary] [Package List] [Test Cases]

EmailServiceTest

Throws EmailException when sending email fails 0.375 s
updatePassword sends email with generated token 0.009 s
registerUser sends email successfully 0.008 s
loginUser sends email successfully 0.009 s

ChatRepositoryTest

Chat can be deleted from repository and DB 0.012 s
Chat can be added to repository and DB 0.015 s
Chat can be updated in repository and DB 0.018 s

NotificationRepositoryTest

Notification can be added to repository and DB 0.009 s
Notification can be updated in repository and DB 0.005 s
Notification can be deleted from repository and DB 0.006 s
General CRUD functionality test for Notification repository 0.006 s

SuperUserServiceTest

Admin can ban a user successfully 0.012 s
Cannot unban a user who is not banned 0.003 s
Get user account fails if not found 0.003 s
Cannot ban a user already banned 0.003 s
Ban user fails if user not found 0.003 s
Moderator cannot ban another moderator 0.003 s
Get specific user account successfully 0.002 s
Admin can unban a user successfully 0.005 s
Admin sees both users and moderators 0.003 s
Moderator sees only regular users 0.003 s

JwtUtilTest

Generate and validate access token 0.045 s
Invalid refresh token returns false 0.003 s
Generate and validate password update token 0.004 s
Invalid password update token returns false 0.002 s
Invalid access token returns false 0.001 s
Generate and validate refresh token 0.002 s

SuperUserControllerTest

Moderator retrieves all users successfully 0.054 s
Admin retrieves all users successfully 0.010 s
Moderator unbans a user successfully 0.011 s
Admin bans a user successfully 0.007 s
Regular user is forbidden from banning a user 0.011 s
Regular user is forbidden from retrieving all users 0.010 s
Admin retrieves a user by ID successfully 0.008 s

MfaServiceTest

Validate TOTP code throws exception for invalid token 0.149 s
Validate TOTP code successfully 0.014 s
Generate MFA throws exception if already enabled 0.007 s
Disable MFA successfully 0.008 s
Enable MFA throws exception for invalid temp token 0.005 s
Validate TOTP code throws exception for invalid TOTP code 0.005 s
Generate MFA for a user successfully 0.008 s
Disable MFA throws exception if not enabled 0.006 s
Enable MFA successfully 0.009 s
Enable MFA throws exception for invalid TOTP code 0.006 s

CityRepositoryTest

General CRUD functionality test for City repository 0.018 s
City can be updated in repository and DB 0.006 s
City can be added to repository and DB 0.006 s
City can be deleted from repository and DB 0.007 s

UserFilesControllerTest

Get all files for the logged-in user successfully 0.049 s
Delete a user file successfully 0.011 s
Get logged-in user's own profile picture successfully 0.010 s
Upload a file successfully for the logged-in user 0.013 s
Remove profile picture successfully for logged-in user 0.007 s
Get another user's profile picture successfully 0.012 s
Set profile picture successfully for logged-in user 0.012 s
Get a specific user file by fileId successfully 0.015 s
Reject profile picture upload if file type is invalid 0.010 s
Get user file by id successfully (duplicate check) 0.009 s

RoleRepositoryTest

Verify that a Role can be added to repository and database 0.112 s
Verify that a Role can be deleted from repository and database 0.020 s
Verify that a Role can be updated in repository and database 0.014 s
General CRUD functionality test for Role 0.012 s

JobApplicationRepositoryTest

Job application can be added to repository and DB 0.021 s
Removing job application then deleting post should succeed 0.016 s
Job application can be deleted from repository and DB 0.028 s
General CRUD functionality test for Job application repository 0.030 s
Job application can be updated in repository and DB 0.019 s
Deleting a job application does not delete associated user or post 0.014 s
Removing job application then deleting user should succeed 0.017 s

ChatMessageRepositoryTest

ChatMessage can be added to repository and DB 0.016 s
ChatMessage can be updated in repository and DB 0.012 s
ChatMessage full CRUD operations test 0.010 s
ChatMessage can be deleted from repository and DB 0.009 s

UserFileServiceTest

Get all user files successfully 0.181 s
Delete profile picture successfully 0.004 s
Add user file successfully 0.005 s
Delete user file successfully 0.004 s
Get profile picture successfully 0.002 s
Get profile picture returns null when none set 0.003 s
Set profile picture successfully 0.008 s
Add user file fails when file already exists 0.007 s
Add user file fails when too many files exist 0.004 s
Delete user file fails due to invalid permission 0.004 s
Get specific user file successfully 0.003 s
Add user file fails when upload throws IOException 0.005 s
Get all user files throws UserNotFoundException when user not found 0.002 s
Set profile picture fails due to wrong file type 0.002 s

TempTokenServiceTest

Validation should return false for unknown tokens 0.002 s
Creating a token should store it and allow validation 0.002 s
Retrieving email for unknown token should return null 0.002 s
Removing a token should invalidate it 0.003 s

CommentRepositoryTest

General CRUD functionality test for Comment repository 0.018 s
Comment can be added to repository and DB 0.019 s
Comment can be updated in repository and DB 0.017 s
Comment can be deleted from repository and DB 0.020 s

UserFileRepositoryTest

Verify that a UserFile can be added to repository and database 0.009 s
Verify that a UserFile can be updated in repository and database 0.007 s
General CRUD functionality test for UserFile 0.007 s
Verify that a UserFile can be deleted from repository and database 0.008 s

UserServiceTest

Throw exception when updating details for nonexistent user 0.391 s
Get user details successfully 0.008 s
Throw exception when password update token is invalid 0.060 s
Update user password successfully 0.016 s
Update user email successfully 0.008 s
Update user details successfully 0.008 s

AuthControllerTest

Generate TOTP for 2FA setup and return secret, QR code, and temporary token 0.022 s
Verify TOTP code and return access and refresh tokens 0.020 s
Send forgot password email successfully 0.022 s
Login a superuser and return access and refresh tokens 0.021 s
Redirect user to Google authentication login page 0.009 s
Enable MFA with first-time TOTP validation 0.021 s
Login a regular user and return access and refresh tokens 0.012 s
Register a new user with role ROLE_USER and return created status with email 0.038 s
Update forgotten password successfully 0.018 s
Disable MFA and return TotpSecretDTO 0.012 s
Refresh JWT token using refresh token cookie 0.011 s

PostRepositoryTest

Verify that a post can be deleted from the repository and database 0.031 s
Verify that deleting a post does not delete the user 0.021 s
Verify that a post can be updated in the repository and database 0.018 s
Verify that a post can be added to the repository and database 0.011 s
Verify that deleting a post cascades to files, comments, and job applications 0.045 s
General CRUD functionality test for posts 0.014 s

AuthServiceTest

Forgot password fails if new password equals current password 0.114 s
Refresh token returns new access token successfully 0.004 s
Forgot password email notification sent successfully 0.004 s
Forgot password update fails with invalid token 0.003 s
Forgot password fails for Google users 0.003 s
Forgot password update succeeds 0.005 s
Registering a user with existing email throws exception 0.004 s
Register a new local user successfully 0.006 s
User login succeeds without MFA enabled 0.055 s
Forgot password fails when user already logged in 0.003 s
User login returns temporary token when MFA is enabled 0.003 s

UserRepositoryTest

Verify that a User can be added to repository and database 0.011 s
General CRUD functionality test for User 0.011 s
Verify that a User can be deleted from repository and database 0.011 s
Verify that updating a User cascades changes to UserSecret, UserFiles, and Notifications 0.010 s

PostServiceTest

Update post fails if user is not owner 0.243 s
Apply to own post throws InvalidPermissionException 0.007 s
Delete post successfully 0.009 s
Update post data successfully 0.007 s
Close post successfully 0.006 s
Get available posts returns only new posts 0.005 s
Check applied status returns true when user has applied 0.005 s
Apply to a post successfully 0.009 s
Create post successfully 0.007 s
Create post fails when user not found 0.003 s

UserControllerTest

Get user details successfully using access token 0.253 s
Send password update email successfully 0.033 s
Update user password successfully and refresh login cookies 0.153 s
Update user email successfully and refresh login cookies 0.031 s
Logout user successfully and clear cookies 0.018 s
Update user details successfully 0.032 s

PostControllerTest

Add a comment to a post and return HTTP 200 0.030 s
Retrieve posts the user is involved in and return HTTP 200 0.013 s
Delete a post by ID and return success message 0.008 s
Update an existing post and return HTTP 200 0.038 s
Change the status of a post and return updated status DTO 0.014 s
Close a post successfully and return confirmation message 0.009 s
Get a post by its ID and return HTTP 200 0.008 s
Reject an applicant for a post and return success message 0.007 s
Cancel a user's application to a post and return success message 0.009 s
Close an unsuccessful post and return confirmation message 0.009 s
Check if the user has applied to a post and return true/false 0.008 s
Retrieve all available posts and return HTTP 200 0.008 s
Apply to a post and return job application response 0.013 s
Create a new post and return HTTP 201 0.026 s
Choose an applicant for a post and return updated post info 0.009 s
Retrieve posts created by the user and return HTTP 200 0.008 s

ReportTypeRepositoryTest

General CRUD functionality test for ReportType 0.013 s
Verify that a ReportType can be deleted from repository and database 0.010 s
Verify that a ReportType can be added to repository and database 0.009 s
Verify that a ReportType can be updated in repository and database 0.010 s

PostFileServiceTest

Add file throws InvalidPermissionException if user is not owner 0.245 s
Get files throws EntityNotFoundException if post not found 0.003 s
Add a file to a post successfully 0.008 s
Add file throws exception if S3 upload fails 0.011 s
Get a single post file successfully 0.005 s
Delete post file successfully 0.004 s
Add file throws EntityNotFoundException if post not found 0.004 s
Add file throws exception if max files exceeded 0.006 s
Delete post file throws EntityNotFoundException if file not found 0.003 s
Delete post file throws InvalidPermissionException if not owner 0.004 s
Add file throws exception if file is duplicate 0.004 s
Get a single post file throws EntityNotFoundException if file not found 0.003 s
Get all files for a post successfully 0.003 s

ReportRepositoryTest

Verify that a Report can be deleted from repository and database 0.045 s
Verify that updating a Report preserves original integrity 0.020 s
Verify that a Report can be saved to repository and database 0.019 s

PostStatusRepositoryTest

Verify that a PostStatus can be updated in repository and database 0.007 s
Verify that a PostStatus can be deleted from repository and database 0.006 s
Verify that a PostStatus can be added to repository and database 0.020 s
General CRUD functionality test for PostStatus 0.013 s

ReviewRepositoryTest

Verify behavior when deleting a user associated with a Review 0.509 s
Verify that a Review can be updated in repository and database 0.009 s
Verify that a Review can be saved to repository and database 0.007 s
General CRUD functionality test for Review 0.028 s

PostFileControllerTest

Upload a file to a post and return success message 0.016 s
Download a specific post file by ID and return HTTP 200 0.015 s
Delete a post file by ID and return success message 0.011 s
Retrieve all files for a post and return HTTP 200 0.012 s