'when-thenReturn' sets up expected behavior for mocks.
In Mockito, the 'when-thenReturn' construct is used to specify what a mock should return when a particular method is called. This helps simulate different scenarios during testing. For example, if you want your mock PaymentGateway to always succeed, you can use 'when(gateway.process()).thenReturn(true);' to ensure tests don't fail due to actual API behavior.