Added expected exception in test