Author: Sam French

Mocking Static Singletons in Java (Mockito 3.4+, EasyMock, JMockit)

A common problem for Java developers that wish to get comprehensive unit test coverage is handling the mocking of singletons that are implemented using static method calls. Let’s look at how we can mock singleton behavior using three common Java testing libraries Mockito, EasyMock and JMockit. Part 1: Write Code to Test To start with, […]

package.json scripts

When using npm (commonly with nodejs), we can pre-define command line commands in the package.json file, using the scripts option. Use Case: Pre-Standardized Commands Per Organization Description: Allow teams to standardize commands to allow easy cross-project development and collaboration. In our example, we will standardize a command extended-test that should be run by all developers […]