Replaced var by val in unit test