Fixed the unit tests that broke during the last sonar violation fixes