jhonatansanchezp-meli / be_java_hisp_w26_g09

0 stars 0 forks source link

T-0002 #39

Closed fabian001254 closed 4 months ago

ggomezr1403 commented 4 months ago

T-0002 - Unfollow Functionality

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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.