Test cases have been created for the unfollow functionality in the UserServiceImpl service. These test cases focus on ensuring that the unfollowUser method behaves correctly in a variety of scenarios.
Test to unfollow a user with valid IDs and roles: Verifies that the unfollowUser method executes successfully when valid user IDs and roles are provided. It ensures that the customer user can unfollow the seller user correctly.
Test to unfollow a user who is not on the followed list: Verifies that the unfollowUser method throws a BadRequestException if the user being unfollowed is not in the customer user's followed list. This ensures that only users who are in the followed list can be unfollowed.
Test to unfollow a user who wants to unfollow themselves: Verifies that the unfollowUser method throws a BadRequestException if the user attempts to unfollow themselves. This prevents the illogical scenario of a user trying to unfollow themselves.
Test to unfollow a user with invalid roles: Verifies that the unfollowUser method throws a BadRequestException if the user client or the user being unfollowed have invalid roles. This ensures that only users with valid roles can be unfollowed.
T-0002 - Unfollow Functionality
Test cases have been created for the unfollow functionality in the
UserServiceImpl
service. These test cases focus on ensuring that theunfollowUser
method behaves correctly in a variety of scenarios.unfollowUser
method executes successfully when valid user IDs and roles are provided. It ensures that the customer user can unfollow the seller user correctly.unfollowUser
method throws aBadRequestException
if the user being unfollowed is not in the customer user's followed list. This ensures that only users who are in the followed list can be unfollowed.unfollowUser
method throws aBadRequestException
if the user attempts to unfollow themselves. This prevents the illogical scenario of a user trying to unfollow themselves.unfollowUser
method throws aBadRequestException
if the user client or the user being unfollowed have invalid roles. This ensures that only users with valid roles can be unfollowed.