Transitions: Correct exception in unit tests

Fixes gh-7458