Prevent NPE when running unit test