Fix tests when running mvn tests
(cherry picked from commit 1edd72e)