Patterns for Saner Mocking

It is common to see mocks being setup this way in unit tests. scenario("Test Case 1") { ... when(addressResolutionService.resolve(...)).thenReturn(...) when(vendorInventoryService.checkInventory(...)).thenReturn(...) ... .... another bunch of when and then returns when(shipmentService.schedule(...)).thenReturn(...) ...thisIsTheActualCalltoTest(...) verify(vendorInventoryService, 1).checkInventory(...) ... other such verifications } scenario("Test Case…