fix NPE when directory doesn't exist
extract static utility method to setup test repository
fix DefaultProfileSpec
fix ProfileRepositorySpec