Making unit tests flexible to receive a session instance