Skip to content

refactor: validation + throw exception #78

refactor: validation + throw exception

refactor: validation + throw exception #78

GitHub Actions / Production-Unit-Test-Results succeeded Jun 7, 2024 in 0s

105 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest.xml 13s
target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest$HappyCase.xml 4✅ 123ms
target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest$UnHappyCase.xml 7✅ 12s
target/surefire-reports/TEST-com.learning.yasminishop.controller.CartControllerTest.xml 5✅ 4s
target/surefire-reports/TEST-com.learning.yasminishop.controller.CategoryControllerTest.xml 7✅ 8s
target/surefire-reports/TEST-com.learning.yasminishop.controller.OrderControllerTest.xml 4✅ 3s
target/surefire-reports/TEST-com.learning.yasminishop.controller.PermissionControllerTest.xml 3✅ 685ms
target/surefire-reports/TEST-com.learning.yasminishop.controller.ProductControllerTest.xml 6✅ 1s
target/surefire-reports/TEST-com.learning.yasminishop.controller.RoleControllerTest.xml 3✅ 687ms
target/surefire-reports/TEST-com.learning.yasminishop.controller.UserControllerTest.xml 10✅ 844ms
target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest.xml 866ms
target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest$HappyCase.xml 4✅ 20ms
target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest$UnHappyCase.xml 6✅ 841ms
target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest.xml 989ms
target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest$HappyCase.xml 5✅ 23ms
target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest$UnhappyCase.xml 1✅ 961ms
target/surefire-reports/TEST-com.learning.yasminishop.service.CategoryServiceTest.xml 767ms
target/surefire-reports/TEST-com.learning.yasminishop.service.CategoryServiceTest$HappyCase.xml 7✅ 762ms
target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest.xml 769ms
target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest$HappyCase.xml 5✅ 25ms
target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest$UnHappyCase.xml 3✅ 739ms
target/surefire-reports/TEST-com.learning.yasminishop.service.PermissionServiceTest.xml 907ms
target/surefire-reports/TEST-com.learning.yasminishop.service.PermissionServiceTest$HappyCase.xml 3✅ 898ms
target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest.xml 956ms
target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest$HappyCase.xml 7✅ 37ms
target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest$UnhappyCase.xml 2✅ 916ms
target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest.xml 598ms
target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest$HappyCase.xml 2✅ 14ms
target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest$UnHappyCase.xml 2✅ 579ms
target/surefire-reports/TEST-com.learning.yasminishop.service.RoleServiceTest.xml 681ms
target/surefire-reports/TEST-com.learning.yasminishop.service.RoleServiceTest$HappyCase.xml 3✅ 677ms
target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest.xml 755ms
target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest$HappyCase.xml 4✅ 132ms
target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest$UnHappyCase.xml 2✅ 617ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.AuthenticationControllerTest 13s

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest$HappyCase.xml

4 tests were completed in 123ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.AuthenticationControllerTest$HappyCase 4✅ 123ms

✅ com.learning.yasminishop.controller.AuthenticationControllerTest$HappyCase

✅ refresh_validRequest_success
✅ register_validRequest_success
✅ logout_validRequest_success
✅ authenticate_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.AuthenticationControllerTest$UnHappyCase.xml

7 tests were completed in 12s with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.AuthenticationControllerTest$UnHappyCase 7✅ 12s

✅ com.learning.yasminishop.controller.AuthenticationControllerTest$UnHappyCase

✅ register_invalidEmail_fail
✅ logout_nullToken_fail
✅ authenticate_nullPassword_fail
✅ refresh_nullToken_fail
✅ authenticate_invalidPassword_fail
✅ authenticate_invalidEmail_fail
✅ authenticate_nullEmail_fail

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.CartControllerTest.xml

5 tests were completed in 4s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.CartControllerTest 5✅ 4s

✅ com.learning.yasminishop.controller.CartControllerTest

✅ deleteCart_validRequest_success
✅ createCart_validRequest_success
✅ updateCart_validRequest_success
✅ getAllCarts_validRequest_success
✅ getCartItemsByIds_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.CategoryControllerTest.xml

7 tests were completed in 8s with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.CategoryControllerTest 7✅ 8s

✅ com.learning.yasminishop.controller.CategoryControllerTest

✅ getCategoryById_validRequest_success
✅ getAllCategories_validRequest_success
✅ createCategory_validRequest_success
✅ deleteCategories_validRequest_success
✅ toggleAvailability_validRequest_success
✅ getCategoryBySlug_validRequest_success
✅ getAllCategoriesForAdmin_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.OrderControllerTest.xml

4 tests were completed in 3s with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.OrderControllerTest 4✅ 3s

✅ com.learning.yasminishop.controller.OrderControllerTest

✅ getOrderById_validRequest_success
✅ getOrderByIdForAdmin_validRequest_success
✅ getAllOrders_validRequest_success
✅ getAllOrdersForAdmin_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.PermissionControllerTest.xml

3 tests were completed in 685ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.PermissionControllerTest 3✅ 685ms

✅ com.learning.yasminishop.controller.PermissionControllerTest

✅ getAll_validRequest_success
✅ delete_validRequest_success
✅ create_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.ProductControllerTest.xml

6 tests were completed in 1s with 6 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.ProductControllerTest 6✅ 1s

✅ com.learning.yasminishop.controller.ProductControllerTest

✅ getBySlug_validRequest_success
✅ updateProduct_validRequest_success
✅ deleteProduct_validRequest_success
✅ createProduct_validRequest_success
✅ getAllForAdmin_validRequest_success
✅ getById_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.RoleControllerTest.xml

3 tests were completed in 687ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.RoleControllerTest 3✅ 687ms

✅ com.learning.yasminishop.controller.RoleControllerTest

✅ deleteRole_validRequest_success
✅ createRole_validRequest_success
✅ getAll_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.controller.UserControllerTest.xml

10 tests were completed in 844ms with 10 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.controller.UserControllerTest 10✅ 844ms

✅ com.learning.yasminishop.controller.UserControllerTest

✅ getUser_validRequest_success
✅ getMyInfo_validRequest_success
✅ deleteUser_validRequest_success
✅ updateUser_emptyFirstName_fail
✅ updateUser_dobInvalid_fail
✅ updateUser_validRequest_success
✅ updateUser_passwordInvalid_fail
✅ updateUser_emptyRole_fail
✅ getAllUsers_validRequest_success
✅ getMyInfo_unauthenticatedRequest_failure

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.AuthenticationServiceTest 866ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest$HappyCase.xml

4 tests were completed in 20ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.AuthenticationServiceTest$HappyCase 4✅ 20ms

✅ com.learning.yasminishop.service.AuthenticationServiceTest$HappyCase

✅ refresh_validRequest_success
✅ register_validRequest_success
✅ logout_validRequest_success
✅ authenticate_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.AuthenticationServiceTest$UnHappyCase.xml

6 tests were completed in 841ms with 6 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.AuthenticationServiceTest$UnHappyCase 6✅ 841ms

✅ com.learning.yasminishop.service.AuthenticationServiceTest$UnHappyCase

✅ refresh_userNotFound_throwException
✅ refresh_invalidToken_throwException
✅ logout_invalidToken_throwException
✅ authenticate_userNotFound_throwException
✅ register_emailAlreadyExists_throwException
✅ authenticate_invalidPassword_throwException

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.CartServiceTest 989ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest$HappyCase.xml

5 tests were completed in 23ms with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.CartServiceTest$HappyCase 5✅ 23ms

✅ com.learning.yasminishop.service.CartServiceTest$HappyCase

✅ getAll_validRequest_success
✅ update_validRequest_success
✅ delete_validRequest_success
✅ getCartByIds_validRequest_success
✅ create_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.CartServiceTest$UnhappyCase.xml

1 tests were completed in 961ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.CartServiceTest$UnhappyCase 1✅ 961ms

✅ com.learning.yasminishop.service.CartServiceTest$UnhappyCase

✅ create_productNotFound_throwException

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.CategoryServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.CategoryServiceTest 767ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.CategoryServiceTest$HappyCase.xml

7 tests were completed in 762ms with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.CategoryServiceTest$HappyCase 7✅ 762ms

✅ com.learning.yasminishop.service.CategoryServiceTest$HappyCase

✅ getBySlug_validRequest_success
✅ getAllCategories_validRequest_success
✅ update_validRequest_success
✅ createCategory_validRequest_success
✅ delete_validRequest_success
✅ toggleAvailability_validRequest_success
✅ getCategory_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.OrderServiceTest 769ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest$HappyCase.xml

5 tests were completed in 25ms with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.OrderServiceTest$HappyCase 5✅ 25ms

✅ com.learning.yasminishop.service.OrderServiceTest$HappyCase

✅ getAllOrderByUser_validRequest_success
✅ getOrderById_validRequest_success
✅ getOrderByIdForAdmin_validRequest_success
✅ updateOrderStatus_validRequest_success
✅ getAllOrders_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.OrderServiceTest$UnHappyCase.xml

3 tests were completed in 739ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.OrderServiceTest$UnHappyCase 3✅ 739ms

✅ com.learning.yasminishop.service.OrderServiceTest$UnHappyCase

✅ getOrderById_orderNotFound_throwException
✅ create_cartItemNotFound_throwException
✅ create_userNotFound_throwException

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.PermissionServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.PermissionServiceTest 907ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.PermissionServiceTest$HappyCase.xml

3 tests were completed in 898ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.PermissionServiceTest$HappyCase 3✅ 898ms

✅ com.learning.yasminishop.service.PermissionServiceTest$HappyCase

✅ deletePermission_validRequest_success
✅ createPermission_validRequest_success
✅ getAllPermissions_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.ProductServiceTest 956ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest$HappyCase.xml

7 tests were completed in 37ms with 7 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.ProductServiceTest$HappyCase 7✅ 37ms

✅ com.learning.yasminishop.service.ProductServiceTest$HappyCase

✅ delete_allProductIdsExistAndNoneInOrderOrCart_success
✅ update_validRequest_success
✅ createProduct_validRequest_success
✅ getAllProductsForAdmin_validRequest_success
✅ toggleAvailability_validRequest_success
✅ getBySlug_validSlug_success
✅ getById_validId_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.ProductServiceTest$UnhappyCase.xml

2 tests were completed in 916ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.ProductServiceTest$UnhappyCase 2✅ 916ms

✅ com.learning.yasminishop.service.ProductServiceTest$UnhappyCase

✅ delete_productInOrderOrCart_throwsException
✅ delete_someProductIdsDoNotExist_throwsException

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.RatingServiceTest 598ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest$HappyCase.xml

2 tests were completed in 14ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.RatingServiceTest$HappyCase 2✅ 14ms

✅ com.learning.yasminishop.service.RatingServiceTest$HappyCase

✅ getRatings_validRequest_success
✅ create_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.RatingServiceTest$UnHappyCase.xml

2 tests were completed in 579ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.RatingServiceTest$UnHappyCase 2✅ 579ms

✅ com.learning.yasminishop.service.RatingServiceTest$UnHappyCase

✅ create_ratingAlreadyExists_exception
✅ create_productNotFound_throwException

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.RoleServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.RoleServiceTest 681ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.RoleServiceTest$HappyCase.xml

3 tests were completed in 677ms with 3 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.RoleServiceTest$HappyCase 3✅ 677ms

✅ com.learning.yasminishop.service.RoleServiceTest$HappyCase

✅ getAll_validRequest_success
✅ delete_validRequest_success
✅ create_validRequest_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.UserServiceTest 755ms

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest$HappyCase.xml

4 tests were completed in 132ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.UserServiceTest$HappyCase 4✅ 132ms

✅ com.learning.yasminishop.service.UserServiceTest$HappyCase

✅ getMyInfo_validRequest_success
✅ deleteUser_valid_success
✅ updateUser_validRequest_success
✅ getUserById_valid_success

✅ target/surefire-reports/TEST-com.learning.yasminishop.service.UserServiceTest$UnHappyCase.xml

2 tests were completed in 617ms with 2 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.learning.yasminishop.service.UserServiceTest$UnHappyCase 2✅ 617ms

✅ com.learning.yasminishop.service.UserServiceTest$UnHappyCase

✅ updateUser_notFoundUser_error
✅ getMyInfo_userNotFound_error