One very peculiar issue I’ve run into during development is an issue where I have a parent pom.xml file and a child pom.xml file. The child pom.xml file imports the parent artifact as a dependency. Now, when we make changes to dependencies in the parent pom.xml file, we don’t see them reflected when building the […]
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 […]