In class domain.Client in method deposit the exception chaining code in line 121 is not executed by the test suite.
In order to be able to throw an exception in the body of method deposit the AccountRepository should be mocked.
We should use Mockito for this purpose.
Done in ClientTest.whenDepositFails_thenCauseShouldBeContainedInDepositFailure().
Additionally the code coverage in the domain package is increased to 100% by adding more test cases.
In class
domain.Client
in methoddeposit
the exception chaining code in line 121 is not executed by the test suite. In order to be able to throw an exception in the body of methoddeposit
theAccountRepository
should be mocked. We should use Mockito for this purpose.