Mini project: unit-test the ShopLite order service
60 min · Intermediate
Need help? Ask a tutor on WhatsApp (opens in a new tab)Placing an order is ShopLite's most important rule, and right now only slow integration tests against MySQL check it. A Mockito unit test checks OrderService on its own, every rule and every failure, in about a second.
What you will learn
What you will learn
- Unit-testing a Spring service without Spring
- ArgumentCaptor on a saved entity
- InOrder for lock order
- Error-path tests with never()
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.