Fuxed unit test that passed in IDE but not from gradle build. Also fixed CodeNarc violations. Thank you Travis CI.