...

/

What’s Important to Get Right When Using Mocks?

What’s Important to Get Right When Using Mocks?

Learn the right way to use mock in your tests.

Best scenario

In the best case, we end up with a single-line arranged a portion of our test that creates an expectation using Mockito’s when(...).then(...) construction. We have a single-line act and a single assert. These are tests we can quickly read, understand, and trust.

Tests using mocks should clearly state “what’s going on”. ...

Access this course and 1400+ top-rated courses and projects.