Fix autowiring of beans for tests