Made changes related to proper Autowiring to avoid NPEs in tests