Archive for category mockito

About using Test Doubles in tests

I have just read an interesting chapter from the Software Engineering book at Google about using Test Doubles in tests.

The chapter discuss the various techniques of using test doubles in tests along with the pros and cons of using real implementations, fakes, stubbing with the support of mocking frameworks and interaction testing. It also refers to the benefits of running Contract Tests against the API’s public interface to catch contract changes prior to the production environment.

In my opinion, it is worth reading it to be aware of good practices when writing unit tests. Drop your comments here about what you think about it.

Tags: , , , , , , , , , ,

Jcombiner: Combinations of collections for Java

JCombiner is a framework to generate combinations of collections for Java. I have written it in Java 11 using Java 9 modules (JPMS) and Gradle as build tool. JUnit 5 and Mockito are used for unit testing and Jacoco for code coverage. Streams and the Collectors API are extensively used throughout the development of JCombiner project.

Jcombiner’s source code is available under GitHub.

Code examples of its usage can be found on GitHub here. More examples can be found on this module inside JCombiner.

Share your comments about this framework here! Please feel free to contribute to it, more features are welcome!

Tags: , , , , , , , , , , , , , , , ,