jhonatansanchezp-meli / be_java_hisp_w26_g09

0 stars 0 forks source link

T-0001 #38

Closed fabian001254 closed 6 months ago

fabian001254 commented 6 months ago

Medio dia

ggomezr1403 commented 6 months ago

T-0001 - Follow Functionality

Test cases have been created for the follow functionality in the UserServiceImpl service. These test cases focus on ensuring that the follow method behaves correctly in a variety of scenarios.

  1. Test for following a user with valid IDs and roles: Verifies that the follow method executes successfully when valid user IDs and roles are provided. It ensures that the customer user can follow the seller user correctly.
  2. Test for following a non-existent user: Verifies that the follow method throws a NotFoundException if the user being followed does not exist in the repository. This ensures proper handling of cases where the user to be followed is not available.
  3. Test for following users with the same role: Verifies that the follow method throws a BadRequestException if both the customer and seller users have the same role. This ensures that users can only follow users with different roles.
  4. Test for following a user who is already in the followed list: Verifies that the follow method throws a BadRequestException if the user being followed is already in the customer user's followed list. This prevents a user from following the same user multiple times.