JAL-1270 protection against NullPointer when run as JUnit