Make test work correctly when run as "maven test". It would appear that this causes junit tests to run in a custom classloader which didn't work with the previous code.