This PR adds test cases for the OrderService class in the src/test/java/com/tw/darkhorse/service/impl/OrderServiceTest.java file. The test cases cover the createOrder and cancelOrder methods of the OrderService class.
Summary
Added a new test class OrderServiceTest to test the OrderService class.
Added a test method should_create_order_successful to test the createOrder method of the OrderService class. This test method verifies that the createOrder method returns the expected Order object.
Added a test method should_cancel_order_successful to test the cancelOrder method of the OrderService class. This test method verifies that the cancelOrder method cancels the order successfully.
Added a test method should_throw_exception_when_order_not_found to test the cancelOrder method of the OrderService class when the order does not exist. This test method verifies that the cancelOrder method throws a BusinessException.
Added a test method should_throw_exception_when_seat_manager_fails_to_release_seat to test the cancelOrder method of the OrderService class when the seat manager server fails to release the seat. This test method verifies that the cancelOrder method throws a BusinessException.
Fixes #3.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/generate-test-cases
🎉 Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This PR adds test cases for the OrderService class in the src/test/java/com/tw/darkhorse/service/impl/OrderServiceTest.java file. The test cases cover the createOrder and cancelOrder methods of the OrderService class.
Summary
Fixes #3.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: